The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
135:176b8275d35d
Child:
139:856d2700e60b
Release 136 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 122:f9eeca106725 1 /**
Kojto 122:f9eeca106725 2 ******************************************************************************
Kojto 122:f9eeca106725 3 * @file stm32f7xx_hal_mdios.h
Kojto 122:f9eeca106725 4 * @author MCD Application Team
<> 135:176b8275d35d 5 * @version V1.1.2
<> 135:176b8275d35d 6 * @date 23-September-2016
Kojto 122:f9eeca106725 7 * @brief Header file of MDIOS HAL module.
Kojto 122:f9eeca106725 8 ******************************************************************************
Kojto 122:f9eeca106725 9 * @attention
Kojto 122:f9eeca106725 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 122:f9eeca106725 12 *
Kojto 122:f9eeca106725 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 122:f9eeca106725 14 * are permitted provided that the following conditions are met:
Kojto 122:f9eeca106725 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 122:f9eeca106725 16 * this list of conditions and the following disclaimer.
Kojto 122:f9eeca106725 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 122:f9eeca106725 18 * this list of conditions and the following disclaimer in the documentation
Kojto 122:f9eeca106725 19 * and/or other materials provided with the distribution.
Kojto 122:f9eeca106725 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 122:f9eeca106725 21 * may be used to endorse or promote products derived from this software
Kojto 122:f9eeca106725 22 * without specific prior written permission.
Kojto 122:f9eeca106725 23 *
Kojto 122:f9eeca106725 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 122:f9eeca106725 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 122:f9eeca106725 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 122:f9eeca106725 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 122:f9eeca106725 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 122:f9eeca106725 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 122:f9eeca106725 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 122:f9eeca106725 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 122:f9eeca106725 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 122:f9eeca106725 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 122:f9eeca106725 34 *
Kojto 122:f9eeca106725 35 ******************************************************************************
Kojto 122:f9eeca106725 36 */
Kojto 122:f9eeca106725 37
Kojto 122:f9eeca106725 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 122:f9eeca106725 39 #ifndef __STM32F7xx_HAL_MDIOS_H
Kojto 122:f9eeca106725 40 #define __STM32F7xx_HAL_MDIOS_H
Kojto 122:f9eeca106725 41
Kojto 122:f9eeca106725 42 #ifdef __cplusplus
Kojto 122:f9eeca106725 43 extern "C" {
Kojto 122:f9eeca106725 44 #endif
Kojto 122:f9eeca106725 45
Kojto 122:f9eeca106725 46 #if defined (MDIOS)
Kojto 122:f9eeca106725 47
Kojto 122:f9eeca106725 48 /* Includes ------------------------------------------------------------------*/
Kojto 122:f9eeca106725 49 #include "stm32f7xx_hal_def.h"
Kojto 122:f9eeca106725 50
Kojto 122:f9eeca106725 51 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 122:f9eeca106725 52 * @{
Kojto 122:f9eeca106725 53 */
Kojto 122:f9eeca106725 54
Kojto 122:f9eeca106725 55 /** @addtogroup MDIOS
Kojto 122:f9eeca106725 56 * @{
Kojto 122:f9eeca106725 57 */
Kojto 122:f9eeca106725 58
Kojto 122:f9eeca106725 59 /* Exported types ------------------------------------------------------------*/
Kojto 122:f9eeca106725 60 /** @defgroup MDIOS_Exported_Types MDIOS Exported Types
Kojto 122:f9eeca106725 61 * @{
Kojto 122:f9eeca106725 62 */
Kojto 122:f9eeca106725 63
Kojto 122:f9eeca106725 64 /** @defgroup MDIOS_Exported_Types_Group1 MDIOS State structures definition
Kojto 122:f9eeca106725 65 * @{
Kojto 122:f9eeca106725 66 */
Kojto 122:f9eeca106725 67
Kojto 122:f9eeca106725 68 typedef enum
Kojto 122:f9eeca106725 69 {
Kojto 122:f9eeca106725 70 HAL_MDIOS_STATE_RESET = 0x00U, /*!< Peripheral not yet Initialized or disabled */
Kojto 122:f9eeca106725 71 HAL_MDIOS_STATE_READY = 0x01U, /*!< Peripheral Initialized and ready for use */
Kojto 122:f9eeca106725 72 HAL_MDIOS_STATE_BUSY = 0x02U, /*!< an internal process is ongoing */
Kojto 122:f9eeca106725 73 HAL_MDIOS_STATE_ERROR = 0x04U /*!< Reception process is ongoing */
Kojto 122:f9eeca106725 74 }HAL_MDIOS_StateTypeDef;
Kojto 122:f9eeca106725 75
Kojto 122:f9eeca106725 76 /**
Kojto 122:f9eeca106725 77 * @}
Kojto 122:f9eeca106725 78 */
Kojto 122:f9eeca106725 79
Kojto 122:f9eeca106725 80 /** @defgroup MDIOS_Exported_Types_Group2 MDIOS Init Structure definition
Kojto 122:f9eeca106725 81 * @{
Kojto 122:f9eeca106725 82 */
Kojto 122:f9eeca106725 83
Kojto 122:f9eeca106725 84 typedef struct
Kojto 122:f9eeca106725 85 {
Kojto 122:f9eeca106725 86 uint32_t PortAddress; /*!< Specifies the MDIOS port address.
Kojto 122:f9eeca106725 87 This parameter can be a value from 0 to 31 */
Kojto 122:f9eeca106725 88 uint32_t PreambleCheck; /*!< Specifies whether the preamble check is enabled or disabled.
Kojto 122:f9eeca106725 89 This parameter can be a value of @ref MDIOS_Preamble_Check */
Kojto 122:f9eeca106725 90 }MDIOS_InitTypeDef;
Kojto 122:f9eeca106725 91
Kojto 122:f9eeca106725 92 /**
Kojto 122:f9eeca106725 93 * @}
Kojto 122:f9eeca106725 94 */
Kojto 122:f9eeca106725 95
Kojto 122:f9eeca106725 96 /** @defgroup MDIOS_Exported_Types_Group4 MDIOS handle Structure definition
Kojto 122:f9eeca106725 97 * @{
Kojto 122:f9eeca106725 98 */
Kojto 122:f9eeca106725 99
Kojto 122:f9eeca106725 100 typedef struct
Kojto 122:f9eeca106725 101 {
Kojto 122:f9eeca106725 102 MDIOS_TypeDef *Instance; /*!< Register base address */
Kojto 122:f9eeca106725 103
Kojto 122:f9eeca106725 104 MDIOS_InitTypeDef Init; /*!< MDIOS Init Structure */
Kojto 122:f9eeca106725 105
Kojto 122:f9eeca106725 106 __IO HAL_MDIOS_StateTypeDef State; /*!< MDIOS communication state */
Kojto 122:f9eeca106725 107
Kojto 122:f9eeca106725 108 HAL_LockTypeDef Lock; /*!< MDIOS Lock */
Kojto 122:f9eeca106725 109 }MDIOS_HandleTypeDef;
Kojto 122:f9eeca106725 110
Kojto 122:f9eeca106725 111 /**
Kojto 122:f9eeca106725 112 * @}
Kojto 122:f9eeca106725 113 */
Kojto 122:f9eeca106725 114
Kojto 122:f9eeca106725 115 /**
Kojto 122:f9eeca106725 116 * @}
Kojto 122:f9eeca106725 117 */
Kojto 122:f9eeca106725 118
Kojto 122:f9eeca106725 119 /* Exported constants --------------------------------------------------------*/
Kojto 122:f9eeca106725 120 /** @defgroup MDIOS_Exported_Constants MDIOS Exported Constants
Kojto 122:f9eeca106725 121 * @{
Kojto 122:f9eeca106725 122 */
Kojto 122:f9eeca106725 123
Kojto 122:f9eeca106725 124 /** @defgroup MDIOS_Preamble_Check MDIOS Preamble Check
Kojto 122:f9eeca106725 125 * @{
Kojto 122:f9eeca106725 126 */
Kojto 122:f9eeca106725 127 #define MDIOS_PREAMBLE_CHECK_ENABLE ((uint32_t)0x00000000U)
Kojto 122:f9eeca106725 128 #define MDIOS_PREAMBLE_CHECK_DISABLE MDIOS_CR_DPC
Kojto 122:f9eeca106725 129 /**
Kojto 122:f9eeca106725 130 * @}
Kojto 122:f9eeca106725 131 */
Kojto 122:f9eeca106725 132
Kojto 122:f9eeca106725 133 /** @defgroup MDIOS_Input_Output_Registers_Definitions MDIOS Input Output Registers Definitions
Kojto 122:f9eeca106725 134 * @{
Kojto 122:f9eeca106725 135 */
Kojto 122:f9eeca106725 136 #define MDIOS_REG0 ((uint32_t)0x00000000U)
Kojto 122:f9eeca106725 137 #define MDIOS_REG1 ((uint32_t)0x00000001U)
Kojto 122:f9eeca106725 138 #define MDIOS_REG2 ((uint32_t)0x00000002U)
Kojto 122:f9eeca106725 139 #define MDIOS_REG3 ((uint32_t)0x00000003U)
Kojto 122:f9eeca106725 140 #define MDIOS_REG4 ((uint32_t)0x00000004U)
Kojto 122:f9eeca106725 141 #define MDIOS_REG5 ((uint32_t)0x00000005U)
Kojto 122:f9eeca106725 142 #define MDIOS_REG6 ((uint32_t)0x00000006U)
Kojto 122:f9eeca106725 143 #define MDIOS_REG7 ((uint32_t)0x00000007U)
Kojto 122:f9eeca106725 144 #define MDIOS_REG8 ((uint32_t)0x00000008U)
Kojto 122:f9eeca106725 145 #define MDIOS_REG9 ((uint32_t)0x00000009U)
Kojto 122:f9eeca106725 146 #define MDIOS_REG10 ((uint32_t)0x0000000AU)
Kojto 122:f9eeca106725 147 #define MDIOS_REG11 ((uint32_t)0x0000000BU)
Kojto 122:f9eeca106725 148 #define MDIOS_REG12 ((uint32_t)0x0000000CU)
Kojto 122:f9eeca106725 149 #define MDIOS_REG13 ((uint32_t)0x0000000DU)
Kojto 122:f9eeca106725 150 #define MDIOS_REG14 ((uint32_t)0x0000000EU)
Kojto 122:f9eeca106725 151 #define MDIOS_REG15 ((uint32_t)0x0000000FU)
Kojto 122:f9eeca106725 152 #define MDIOS_REG16 ((uint32_t)0x00000010U)
Kojto 122:f9eeca106725 153 #define MDIOS_REG17 ((uint32_t)0x00000011U)
Kojto 122:f9eeca106725 154 #define MDIOS_REG18 ((uint32_t)0x00000012U)
Kojto 122:f9eeca106725 155 #define MDIOS_REG19 ((uint32_t)0x00000013U)
Kojto 122:f9eeca106725 156 #define MDIOS_REG20 ((uint32_t)0x00000014U)
Kojto 122:f9eeca106725 157 #define MDIOS_REG21 ((uint32_t)0x00000015U)
Kojto 122:f9eeca106725 158 #define MDIOS_REG22 ((uint32_t)0x00000016U)
Kojto 122:f9eeca106725 159 #define MDIOS_REG23 ((uint32_t)0x00000017U)
Kojto 122:f9eeca106725 160 #define MDIOS_REG24 ((uint32_t)0x00000018U)
Kojto 122:f9eeca106725 161 #define MDIOS_REG25 ((uint32_t)0x00000019U)
Kojto 122:f9eeca106725 162 #define MDIOS_REG26 ((uint32_t)0x0000001AU)
Kojto 122:f9eeca106725 163 #define MDIOS_REG27 ((uint32_t)0x0000001BU)
Kojto 122:f9eeca106725 164 #define MDIOS_REG28 ((uint32_t)0x0000001CU)
Kojto 122:f9eeca106725 165 #define MDIOS_REG29 ((uint32_t)0x0000001DU)
Kojto 122:f9eeca106725 166 #define MDIOS_REG30 ((uint32_t)0x0000001EU)
Kojto 122:f9eeca106725 167 #define MDIOS_REG31 ((uint32_t)0x0000001FU)
Kojto 122:f9eeca106725 168 /**
Kojto 122:f9eeca106725 169 * @}
Kojto 122:f9eeca106725 170 */
Kojto 122:f9eeca106725 171
Kojto 122:f9eeca106725 172 /** @defgroup MDIOS_Registers_Flags MDIOS Registers Flags
Kojto 122:f9eeca106725 173 * @{
Kojto 122:f9eeca106725 174 */
Kojto 122:f9eeca106725 175 #define MDIOS_REG0_FLAG ((uint32_t)0x00000001U)
Kojto 122:f9eeca106725 176 #define MDIOS_REG1_FLAG ((uint32_t)0x00000002U)
Kojto 122:f9eeca106725 177 #define MDIOS_REG2_FLAG ((uint32_t)0x00000004U)
Kojto 122:f9eeca106725 178 #define MDIOS_REG3_FLAG ((uint32_t)0x00000008U)
Kojto 122:f9eeca106725 179 #define MDIOS_REG4_FLAG ((uint32_t)0x00000010U)
Kojto 122:f9eeca106725 180 #define MDIOS_REG5_FLAG ((uint32_t)0x00000020U)
Kojto 122:f9eeca106725 181 #define MDIOS_REG6_FLAG ((uint32_t)0x00000040U)
Kojto 122:f9eeca106725 182 #define MDIOS_REG7_FLAG ((uint32_t)0x00000080U)
Kojto 122:f9eeca106725 183 #define MDIOS_REG8_FLAG ((uint32_t)0x00000100U)
Kojto 122:f9eeca106725 184 #define MDIOS_REG9_FLAG ((uint32_t)0x00000200U)
Kojto 122:f9eeca106725 185 #define MDIOS_REG10_FLAG ((uint32_t)0x00000400U)
Kojto 122:f9eeca106725 186 #define MDIOS_REG11_FLAG ((uint32_t)0x00000800U)
Kojto 122:f9eeca106725 187 #define MDIOS_REG12_FLAG ((uint32_t)0x00001000U)
Kojto 122:f9eeca106725 188 #define MDIOS_REG13_FLAG ((uint32_t)0x00002000U)
Kojto 122:f9eeca106725 189 #define MDIOS_REG14_FLAG ((uint32_t)0x00004000U)
Kojto 122:f9eeca106725 190 #define MDIOS_REG15_FLAG ((uint32_t)0x00008000U)
Kojto 122:f9eeca106725 191 #define MDIOS_REG16_FLAG ((uint32_t)0x00010000U)
Kojto 122:f9eeca106725 192 #define MDIOS_REG17_FLAG ((uint32_t)0x00020000U)
Kojto 122:f9eeca106725 193 #define MDIOS_REG18_FLAG ((uint32_t)0x00040000U)
Kojto 122:f9eeca106725 194 #define MDIOS_REG19_FLAG ((uint32_t)0x00080000U)
Kojto 122:f9eeca106725 195 #define MDIOS_REG20_FLAG ((uint32_t)0x00100000U)
Kojto 122:f9eeca106725 196 #define MDIOS_REG21_FLAG ((uint32_t)0x00200000U)
Kojto 122:f9eeca106725 197 #define MDIOS_REG22_FLAG ((uint32_t)0x00400000U)
Kojto 122:f9eeca106725 198 #define MDIOS_REG23_FLAG ((uint32_t)0x00800000U)
Kojto 122:f9eeca106725 199 #define MDIOS_REG24_FLAG ((uint32_t)0x01000000U)
Kojto 122:f9eeca106725 200 #define MDIOS_REG25_FLAG ((uint32_t)0x02000000U)
Kojto 122:f9eeca106725 201 #define MDIOS_REG26_FLAG ((uint32_t)0x04000000U)
Kojto 122:f9eeca106725 202 #define MDIOS_REG27_FLAG ((uint32_t)0x08000000U)
Kojto 122:f9eeca106725 203 #define MDIOS_REG28_FLAG ((uint32_t)0x10000000U)
Kojto 122:f9eeca106725 204 #define MDIOS_REG29_FLAG ((uint32_t)0x20000000U)
Kojto 122:f9eeca106725 205 #define MDIOS_REG30_FLAG ((uint32_t)0x40000000U)
Kojto 122:f9eeca106725 206 #define MDIOS_REG31_FLAG ((uint32_t)0x80000000U)
Kojto 122:f9eeca106725 207 #define MDIOS_ALLREG_FLAG ((uint32_t)0xFFFFFFFFU)
Kojto 122:f9eeca106725 208 /**
Kojto 122:f9eeca106725 209 * @}
Kojto 122:f9eeca106725 210 */
Kojto 122:f9eeca106725 211
Kojto 122:f9eeca106725 212 /** @defgroup MDIOS_Interrupt_sources Interrupt Sources
Kojto 122:f9eeca106725 213 * @{
Kojto 122:f9eeca106725 214 */
Kojto 122:f9eeca106725 215 #define MDIOS_IT_WRITE MDIOS_CR_WRIE
Kojto 122:f9eeca106725 216 #define MDIOS_IT_READ MDIOS_CR_RDIE
Kojto 122:f9eeca106725 217 #define MDIOS_IT_ERROR MDIOS_CR_EIE
Kojto 122:f9eeca106725 218 /**
Kojto 122:f9eeca106725 219 * @}
Kojto 122:f9eeca106725 220 */
Kojto 122:f9eeca106725 221
Kojto 122:f9eeca106725 222 /** @defgroup MDIOS_Interrupt_Flags MDIOS Interrupt Flags
Kojto 122:f9eeca106725 223 * @{
Kojto 122:f9eeca106725 224 */
Kojto 122:f9eeca106725 225 #define MDIOS_TURNAROUND_ERROR_FLAG MDIOS_SR_TERF
Kojto 122:f9eeca106725 226 #define MDIOS_START_ERROR_FLAG MDIOS_SR_SERF
Kojto 122:f9eeca106725 227 #define MDIOS_PREAMBLE_ERROR_FLAG MDIOS_SR_PERF
Kojto 122:f9eeca106725 228 /**
Kojto 122:f9eeca106725 229 * @}
Kojto 122:f9eeca106725 230 */
Kojto 122:f9eeca106725 231
Kojto 122:f9eeca106725 232 /** @defgroup MDIOS_Wakeup_Line MDIOS Wakeup Line
Kojto 122:f9eeca106725 233 * @{
Kojto 122:f9eeca106725 234 */
Kojto 122:f9eeca106725 235 #define MDIOS_WAKEUP_EXTI_LINE ((uint32_t)0x01000000) /* !< EXTI Line 24 */
Kojto 122:f9eeca106725 236 /**
Kojto 122:f9eeca106725 237 * @}
Kojto 122:f9eeca106725 238 */
Kojto 122:f9eeca106725 239
Kojto 122:f9eeca106725 240 /**
Kojto 122:f9eeca106725 241 * @}
Kojto 122:f9eeca106725 242 */
Kojto 122:f9eeca106725 243 /* Exported macros -----------------------------------------------------------*/
Kojto 122:f9eeca106725 244 /** @defgroup MDIOS_Exported_Macros MDIOS Exported Macros
Kojto 122:f9eeca106725 245 * @{
Kojto 122:f9eeca106725 246 */
Kojto 122:f9eeca106725 247
Kojto 122:f9eeca106725 248 /** @brief Reset MDIOS handle state
Kojto 122:f9eeca106725 249 * @param __HANDLE__: MDIOS handle.
Kojto 122:f9eeca106725 250 * @retval None
Kojto 122:f9eeca106725 251 */
Kojto 122:f9eeca106725 252 #define __HAL_MDIOS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_MDIOS_STATE_RESET)
Kojto 122:f9eeca106725 253
Kojto 122:f9eeca106725 254 /**
Kojto 122:f9eeca106725 255 * @brief Enable/Disable the MDIOS peripheral.
Kojto 122:f9eeca106725 256 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 257 * @retval None
Kojto 122:f9eeca106725 258 */
Kojto 122:f9eeca106725 259 #define __HAL_MDIOS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= MDIOS_CR_EN)
Kojto 122:f9eeca106725 260 #define __HAL_MDIOS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~MDIOS_CR_EN)
Kojto 122:f9eeca106725 261
Kojto 122:f9eeca106725 262
Kojto 122:f9eeca106725 263 /**
Kojto 122:f9eeca106725 264 * @brief Enable the MDIOS device interrupt.
Kojto 122:f9eeca106725 265 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 266 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources to be enabled.
Kojto 122:f9eeca106725 267 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 268 * @arg MDIOS_IT_WRITE: Register write interrupt
Kojto 122:f9eeca106725 269 * @arg MDIOS_IT_READ: Register read interrupt
Kojto 122:f9eeca106725 270 * @arg MDIOS_IT_ERROR: Error interrupt
Kojto 122:f9eeca106725 271 * @retval None
Kojto 122:f9eeca106725 272 */
Kojto 122:f9eeca106725 273 #define __HAL_MDIOS_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 122:f9eeca106725 274
Kojto 122:f9eeca106725 275 /**
Kojto 122:f9eeca106725 276 * @brief Disable the MDIOS device interrupt.
Kojto 122:f9eeca106725 277 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 278 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources to be disabled.
Kojto 122:f9eeca106725 279 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 280 * @arg MDIOS_IT_WRITE: Register write interrupt
Kojto 122:f9eeca106725 281 * @arg MDIOS_IT_READ: Register read interrupt
Kojto 122:f9eeca106725 282 * @arg MDIOS_IT_ERROR: Error interrupt
Kojto 122:f9eeca106725 283 * @retval None
Kojto 122:f9eeca106725 284 */
Kojto 122:f9eeca106725 285 #define __HAL_MDIOS_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 122:f9eeca106725 286
Kojto 122:f9eeca106725 287 /** @brief Set MDIOS slave get write register flag
Kojto 122:f9eeca106725 288 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 289 * @param __FLAG__: specifies the write register flag
Kojto 122:f9eeca106725 290 * @retval The state of write flag
Kojto 122:f9eeca106725 291 */
Kojto 122:f9eeca106725 292 #define __HAL_MDIOS_GET_WRITE_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WRFR & (__FLAG__))
Kojto 122:f9eeca106725 293
Kojto 122:f9eeca106725 294 /** @brief MDIOS slave get read register flag
Kojto 122:f9eeca106725 295 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 296 * @param __FLAG__: specifies the read register flag
Kojto 122:f9eeca106725 297 * @retval The state of read flag
Kojto 122:f9eeca106725 298 */
Kojto 122:f9eeca106725 299 #define __HAL_MDIOS_GET_READ_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->RDFR & (__FLAG__))
Kojto 122:f9eeca106725 300
Kojto 122:f9eeca106725 301 /** @brief MDIOS slave get interrupt
Kojto 122:f9eeca106725 302 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 303 * @param __FLAG__ : specifies the Error flag.
Kojto 122:f9eeca106725 304 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 305 * @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
Kojto 122:f9eeca106725 306 * @arg MDIOS_START_ERROR_FLAG: Register read interrupt
Kojto 122:f9eeca106725 307 * @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
Kojto 122:f9eeca106725 308 * @retval The state of the error flag
Kojto 122:f9eeca106725 309 */
Kojto 122:f9eeca106725 310 #define __HAL_MDIOS_GET_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR & (__FLAG__))
Kojto 122:f9eeca106725 311
Kojto 122:f9eeca106725 312 /** @brief MDIOS slave clear interrupt
Kojto 122:f9eeca106725 313 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 314 * @param __FLAG__ : specifies the Error flag.
Kojto 122:f9eeca106725 315 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 316 * @arg MDIOS_TURNARROUND_ERROR_FLAG: Register write interrupt
Kojto 122:f9eeca106725 317 * @arg MDIOS_START_ERROR_FLAG: Register read interrupt
Kojto 122:f9eeca106725 318 * @arg MDIOS_PREAMBLE_ERROR_FLAG: Error interrupt
Kojto 122:f9eeca106725 319 * @retval none
Kojto 122:f9eeca106725 320 */
Kojto 122:f9eeca106725 321 #define __HAL_MDIOS_CLEAR_ERROR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CLRFR) |= (__FLAG__)
Kojto 122:f9eeca106725 322
Kojto 122:f9eeca106725 323 /**
Kojto 122:f9eeca106725 324 * @brief Checks whether the specified MDIOS interrupt is set or not.
Kojto 122:f9eeca106725 325 * @param __HANDLE__: specifies the MDIOS handle.
Kojto 122:f9eeca106725 326 * @param __INTERRUPT__ : specifies the MDIOS interrupt sources
Kojto 122:f9eeca106725 327 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 328 * @arg MDIOS_IT_WRITE: Register write interrupt
Kojto 122:f9eeca106725 329 * @arg MDIOS_IT_READ: Register read interrupt
Kojto 122:f9eeca106725 330 * @arg MDIOS_IT_ERROR: Error interrupt
Kojto 122:f9eeca106725 331 * @retval The state of the interrupt source
Kojto 122:f9eeca106725 332 */
Kojto 122:f9eeca106725 333 #define __HAL_MDIOS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
Kojto 122:f9eeca106725 334
Kojto 122:f9eeca106725 335 /**
Kojto 122:f9eeca106725 336 * @brief Enable the MDIOS WAKEUP Exti Line.
Kojto 122:f9eeca106725 337 * @retval None.
Kojto 122:f9eeca106725 338 */
Kojto 122:f9eeca106725 339 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_IT() (EXTI->IMR |= (MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 340
Kojto 122:f9eeca106725 341 /**
Kojto 122:f9eeca106725 342 * @brief Disable the MDIOS WAKEUP Exti Line.
Kojto 122:f9eeca106725 343 * @retval None.
Kojto 122:f9eeca106725 344 */
Kojto 122:f9eeca106725 345 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 346
Kojto 122:f9eeca106725 347 /**
Kojto 122:f9eeca106725 348 * @brief Enable event on MDIOS WAKEUP Exti Line.
Kojto 122:f9eeca106725 349 * @retval None.
Kojto 122:f9eeca106725 350 */
Kojto 122:f9eeca106725 351 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_EVENT() (EXTI->EMR |= (MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 352
Kojto 122:f9eeca106725 353 /**
Kojto 122:f9eeca106725 354 * @brief Disable event on MDIOS WAKEUP Exti Line.
Kojto 122:f9eeca106725 355 * @retval None.
Kojto 122:f9eeca106725 356 */
Kojto 122:f9eeca106725 357 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 358
Kojto 122:f9eeca106725 359 /**
Kojto 122:f9eeca106725 360 * @brief checks whether the specified MDIOS WAKEUP Exti interrupt flag is set or not.
Kojto 122:f9eeca106725 361 * @retval EXTI MDIOS WAKEUP Line Status.
Kojto 122:f9eeca106725 362 */
Kojto 122:f9eeca106725 363 #define __HAL_MDIOS_WAKEUP_EXTI_GET_FLAG() (EXTI->PR & (MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 364
Kojto 122:f9eeca106725 365 /**
Kojto 122:f9eeca106725 366 * @brief Clear the MDIOS WAKEUP Exti flag.
Kojto 122:f9eeca106725 367 * @retval None.
Kojto 122:f9eeca106725 368 */
Kojto 122:f9eeca106725 369 #define __HAL_MDIOS_WAKEUP_EXTI_CLEAR_FLAG() (EXTI->PR = (MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 370
Kojto 122:f9eeca106725 371 /**
Kojto 122:f9eeca106725 372 * @brief Enables rising edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 373 * @retval None
Kojto 122:f9eeca106725 374 */
Kojto 122:f9eeca106725 375 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER() EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE
Kojto 122:f9eeca106725 376
Kojto 122:f9eeca106725 377 /**
Kojto 122:f9eeca106725 378 * @brief Disables the rising edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 379 * @retval None
Kojto 122:f9eeca106725 380 */
Kojto 122:f9eeca106725 381 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_RISING_EDGE_TRIGGER() EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
Kojto 122:f9eeca106725 382
Kojto 122:f9eeca106725 383 /**
Kojto 122:f9eeca106725 384 * @brief Enables falling edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 385 * @retval None
Kojto 122:f9eeca106725 386 */
Kojto 122:f9eeca106725 387 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR |= (MDIOS_WAKEUP_EXTI_LINE)
Kojto 122:f9eeca106725 388
Kojto 122:f9eeca106725 389 /**
Kojto 122:f9eeca106725 390 * @brief Disables falling edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 391 * @retval None
Kojto 122:f9eeca106725 392 */
Kojto 122:f9eeca106725 393 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
Kojto 122:f9eeca106725 394
Kojto 122:f9eeca106725 395 /**
Kojto 122:f9eeca106725 396 * @brief Enables rising/falling edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 397 * @retval None
Kojto 122:f9eeca106725 398 */
Kojto 122:f9eeca106725 399 #define __HAL_MDIOS_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER() EXTI->RTSR |= MDIOS_WAKEUP_EXTI_LINE;\
Kojto 122:f9eeca106725 400 EXTI->FTSR |= MDIOS_WAKEUP_EXTI_LINE
Kojto 122:f9eeca106725 401
Kojto 122:f9eeca106725 402 /**
Kojto 122:f9eeca106725 403 * @brief Disables rising/falling edge trigger to the MDIOS External interrupt line.
Kojto 122:f9eeca106725 404 * @retval None
Kojto 122:f9eeca106725 405 */
Kojto 122:f9eeca106725 406 #define __HAL_MDIOS_WAKEUP_EXTI_DISABLE_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(MDIOS_WAKEUP_EXTI_LINE);\
Kojto 122:f9eeca106725 407 EXTI->FTSR &= ~(MDIOS_WAKEUP_EXTI_LINE)
Kojto 122:f9eeca106725 408 /**
Kojto 122:f9eeca106725 409 * @brief Generates a Software interrupt on selected EXTI line.
Kojto 122:f9eeca106725 410 * @retval None
Kojto 122:f9eeca106725 411 */
Kojto 122:f9eeca106725 412 #define __HAL_MDIOS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (MDIOS_WAKEUP_EXTI_LINE))
Kojto 122:f9eeca106725 413
Kojto 122:f9eeca106725 414 /**
Kojto 122:f9eeca106725 415 * @}
Kojto 122:f9eeca106725 416 */
Kojto 122:f9eeca106725 417
Kojto 122:f9eeca106725 418 /* Exported functions --------------------------------------------------------*/
Kojto 122:f9eeca106725 419 /** @defgroup MDIOS_Exported_Functions MDIOS Exported Functions
Kojto 122:f9eeca106725 420 * @{
Kojto 122:f9eeca106725 421 */
Kojto 122:f9eeca106725 422
Kojto 122:f9eeca106725 423 /** @addtogroup MDIOS_Exported_Functions_Group1
Kojto 122:f9eeca106725 424 * @{
Kojto 122:f9eeca106725 425 */
Kojto 122:f9eeca106725 426 HAL_StatusTypeDef HAL_MDIOS_Init(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 427 HAL_StatusTypeDef HAL_MDIOS_DeInit(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 428 void HAL_MDIOS_MspInit(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 429 void HAL_MDIOS_MspDeInit(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 430 /**
Kojto 122:f9eeca106725 431 * @}
Kojto 122:f9eeca106725 432 */
Kojto 122:f9eeca106725 433
Kojto 122:f9eeca106725 434 /** @addtogroup MDIOS_Exported_Functions_Group2
Kojto 122:f9eeca106725 435 * @{
Kojto 122:f9eeca106725 436 */
Kojto 122:f9eeca106725 437 HAL_StatusTypeDef HAL_MDIOS_WriteReg(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum, uint16_t Data);
Kojto 122:f9eeca106725 438 HAL_StatusTypeDef HAL_MDIOS_ReadReg(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum, uint16_t *pData);
Kojto 122:f9eeca106725 439
Kojto 122:f9eeca106725 440 uint32_t HAL_MDIOS_GetWrittenRegAddress(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 441 uint32_t HAL_MDIOS_GetReadRegAddress(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 442 HAL_StatusTypeDef HAL_MDIOS_ClearWriteRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
Kojto 122:f9eeca106725 443 HAL_StatusTypeDef HAL_MDIOS_ClearReadRegAddress(MDIOS_HandleTypeDef *hmdios, uint32_t RegNum);
Kojto 122:f9eeca106725 444
Kojto 122:f9eeca106725 445 HAL_StatusTypeDef HAL_MDIOS_EnableEvents(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 446 void HAL_MDIOS_IRQHandler(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 447 void HAL_MDIOS_WriteCpltCallback(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 448 void HAL_MDIOS_ReadCpltCallback(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 449 void HAL_MDIOS_ErrorCallback(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 450 void HAL_MDIOS_WakeUpCallback(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 451 /**
Kojto 122:f9eeca106725 452 * @}
Kojto 122:f9eeca106725 453 */
Kojto 122:f9eeca106725 454
Kojto 122:f9eeca106725 455 /** @addtogroup MDIOS_Exported_Functions_Group3
Kojto 122:f9eeca106725 456 * @{
Kojto 122:f9eeca106725 457 */
Kojto 122:f9eeca106725 458 uint32_t HAL_MDIOS_GetError(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 459 HAL_MDIOS_StateTypeDef HAL_MDIOS_GetState(MDIOS_HandleTypeDef *hmdios);
Kojto 122:f9eeca106725 460 /**
Kojto 122:f9eeca106725 461 * @}
Kojto 122:f9eeca106725 462 */
Kojto 122:f9eeca106725 463
Kojto 122:f9eeca106725 464 /**
Kojto 122:f9eeca106725 465 * @}
Kojto 122:f9eeca106725 466 */
Kojto 122:f9eeca106725 467
Kojto 122:f9eeca106725 468 /* Private types -------------------------------------------------------------*/
Kojto 122:f9eeca106725 469 /** @defgroup MDIOS_Private_Types MDIOS Private Types
Kojto 122:f9eeca106725 470 * @{
Kojto 122:f9eeca106725 471 */
Kojto 122:f9eeca106725 472
Kojto 122:f9eeca106725 473 /**
Kojto 122:f9eeca106725 474 * @}
Kojto 122:f9eeca106725 475 */
Kojto 122:f9eeca106725 476
Kojto 122:f9eeca106725 477 /* Private variables ---------------------------------------------------------*/
Kojto 122:f9eeca106725 478 /** @defgroup MDIOS_Private_Variables MDIOS Private Variables
Kojto 122:f9eeca106725 479 * @{
Kojto 122:f9eeca106725 480 */
Kojto 122:f9eeca106725 481
Kojto 122:f9eeca106725 482 /**
Kojto 122:f9eeca106725 483 * @}
Kojto 122:f9eeca106725 484 */
Kojto 122:f9eeca106725 485
Kojto 122:f9eeca106725 486 /* Private constants ---------------------------------------------------------*/
Kojto 122:f9eeca106725 487 /** @defgroup MDIOS_Private_Constants MDIOS Private Constants
Kojto 122:f9eeca106725 488 * @{
Kojto 122:f9eeca106725 489 */
Kojto 122:f9eeca106725 490
Kojto 122:f9eeca106725 491 /**
Kojto 122:f9eeca106725 492 * @}
Kojto 122:f9eeca106725 493 */
Kojto 122:f9eeca106725 494
Kojto 122:f9eeca106725 495 /* Private macros ------------------------------------------------------------*/
Kojto 122:f9eeca106725 496 /** @defgroup MDIOS_Private_Macros MDIOS Private Macros
Kojto 122:f9eeca106725 497 * @{
Kojto 122:f9eeca106725 498 */
Kojto 122:f9eeca106725 499
Kojto 122:f9eeca106725 500 #define IS_MDIOS_PORTADDRESS(__ADDR__) ((__ADDR__) < 32)
Kojto 122:f9eeca106725 501
Kojto 122:f9eeca106725 502 #define IS_MDIOS_REGISTER(__REGISTER__) ((__REGISTER__) < 32)
Kojto 122:f9eeca106725 503
Kojto 122:f9eeca106725 504 #define IS_MDIOS_PREAMBLECHECK(__PREAMBLECHECK__) (((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_ENABLE) || \
Kojto 122:f9eeca106725 505 ((__PREAMBLECHECK__) == MDIOS_PREAMBLE_CHECK_DISABLE))
Kojto 122:f9eeca106725 506
Kojto 122:f9eeca106725 507 /**
Kojto 122:f9eeca106725 508 * @}
Kojto 122:f9eeca106725 509 */
Kojto 122:f9eeca106725 510
Kojto 122:f9eeca106725 511 /* Private functions ---------------------------------------------------------*/
Kojto 122:f9eeca106725 512 /** @defgroup MDIOS_Private_Functions MDIOS Private Functions
Kojto 122:f9eeca106725 513 * @{
Kojto 122:f9eeca106725 514 */
Kojto 122:f9eeca106725 515
Kojto 122:f9eeca106725 516 /**
Kojto 122:f9eeca106725 517 * @}
Kojto 122:f9eeca106725 518 */
Kojto 122:f9eeca106725 519
Kojto 122:f9eeca106725 520
Kojto 122:f9eeca106725 521 /**
Kojto 122:f9eeca106725 522 * @}
Kojto 122:f9eeca106725 523 */
Kojto 122:f9eeca106725 524
Kojto 122:f9eeca106725 525 /**
Kojto 122:f9eeca106725 526 * @}
Kojto 122:f9eeca106725 527 */
Kojto 122:f9eeca106725 528
Kojto 122:f9eeca106725 529 #endif /* MDIOS */
Kojto 122:f9eeca106725 530
Kojto 122:f9eeca106725 531 #ifdef __cplusplus
Kojto 122:f9eeca106725 532 }
Kojto 122:f9eeca106725 533 #endif
Kojto 122:f9eeca106725 534
Kojto 122:f9eeca106725 535 #endif /* __STM32F7xx_HAL_MDIOS_H */
Kojto 122:f9eeca106725 536
Kojto 122:f9eeca106725 537 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/