Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 86:04dd9b1680ae 1 /**
bogdanm 86:04dd9b1680ae 2 ******************************************************************************
bogdanm 86:04dd9b1680ae 3 * @file stm32f4xx_hal_eth.h
bogdanm 86:04dd9b1680ae 4 * @author MCD Application Team
Kojto 110:165afa46840b 5 * @version V1.4.1
Kojto 110:165afa46840b 6 * @date 09-October-2015
bogdanm 86:04dd9b1680ae 7 * @brief Header file of ETH HAL module.
bogdanm 86:04dd9b1680ae 8 ******************************************************************************
bogdanm 86:04dd9b1680ae 9 * @attention
bogdanm 86:04dd9b1680ae 10 *
Kojto 99:dbbf35b96557 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 86:04dd9b1680ae 12 *
bogdanm 86:04dd9b1680ae 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 86:04dd9b1680ae 14 * are permitted provided that the following conditions are met:
bogdanm 86:04dd9b1680ae 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 86:04dd9b1680ae 16 * this list of conditions and the following disclaimer.
bogdanm 86:04dd9b1680ae 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 86:04dd9b1680ae 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 86:04dd9b1680ae 19 * and/or other materials provided with the distribution.
bogdanm 86:04dd9b1680ae 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 86:04dd9b1680ae 21 * may be used to endorse or promote products derived from this software
bogdanm 86:04dd9b1680ae 22 * without specific prior written permission.
bogdanm 86:04dd9b1680ae 23 *
bogdanm 86:04dd9b1680ae 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 86:04dd9b1680ae 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 86:04dd9b1680ae 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 86:04dd9b1680ae 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 86:04dd9b1680ae 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 86:04dd9b1680ae 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 86:04dd9b1680ae 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 86:04dd9b1680ae 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 86:04dd9b1680ae 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 86:04dd9b1680ae 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 86:04dd9b1680ae 34 *
bogdanm 86:04dd9b1680ae 35 ******************************************************************************
bogdanm 86:04dd9b1680ae 36 */
bogdanm 86:04dd9b1680ae 37
bogdanm 86:04dd9b1680ae 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 86:04dd9b1680ae 39 #ifndef __STM32F4xx_HAL_ETH_H
bogdanm 86:04dd9b1680ae 40 #define __STM32F4xx_HAL_ETH_H
bogdanm 86:04dd9b1680ae 41
bogdanm 86:04dd9b1680ae 42 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 43 extern "C" {
bogdanm 86:04dd9b1680ae 44 #endif
bogdanm 86:04dd9b1680ae 45
Kojto 110:165afa46840b 46 #if defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\
Kojto 110:165afa46840b 47 defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
bogdanm 86:04dd9b1680ae 48 /* Includes ------------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 49 #include "stm32f4xx_hal_def.h"
bogdanm 86:04dd9b1680ae 50
bogdanm 86:04dd9b1680ae 51 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 86:04dd9b1680ae 52 * @{
bogdanm 86:04dd9b1680ae 53 */
bogdanm 86:04dd9b1680ae 54
bogdanm 86:04dd9b1680ae 55 /** @addtogroup ETH
bogdanm 86:04dd9b1680ae 56 * @{
bogdanm 86:04dd9b1680ae 57 */
Kojto 99:dbbf35b96557 58
Kojto 99:dbbf35b96557 59 /** @addtogroup ETH_Private_Macros
Kojto 99:dbbf35b96557 60 * @{
Kojto 99:dbbf35b96557 61 */
Kojto 99:dbbf35b96557 62 #define IS_ETH_PHY_ADDRESS(ADDRESS) ((ADDRESS) <= 0x20)
Kojto 99:dbbf35b96557 63 #define IS_ETH_AUTONEGOTIATION(CMD) (((CMD) == ETH_AUTONEGOTIATION_ENABLE) || \
Kojto 99:dbbf35b96557 64 ((CMD) == ETH_AUTONEGOTIATION_DISABLE))
Kojto 99:dbbf35b96557 65 #define IS_ETH_SPEED(SPEED) (((SPEED) == ETH_SPEED_10M) || \
Kojto 99:dbbf35b96557 66 ((SPEED) == ETH_SPEED_100M))
Kojto 99:dbbf35b96557 67 #define IS_ETH_DUPLEX_MODE(MODE) (((MODE) == ETH_MODE_FULLDUPLEX) || \
Kojto 99:dbbf35b96557 68 ((MODE) == ETH_MODE_HALFDUPLEX))
Kojto 99:dbbf35b96557 69 #define IS_ETH_RX_MODE(MODE) (((MODE) == ETH_RXPOLLING_MODE) || \
Kojto 99:dbbf35b96557 70 ((MODE) == ETH_RXINTERRUPT_MODE))
Kojto 99:dbbf35b96557 71 #define IS_ETH_CHECKSUM_MODE(MODE) (((MODE) == ETH_CHECKSUM_BY_HARDWARE) || \
Kojto 99:dbbf35b96557 72 ((MODE) == ETH_CHECKSUM_BY_SOFTWARE))
Kojto 99:dbbf35b96557 73 #define IS_ETH_MEDIA_INTERFACE(MODE) (((MODE) == ETH_MEDIA_INTERFACE_MII) || \
Kojto 99:dbbf35b96557 74 ((MODE) == ETH_MEDIA_INTERFACE_RMII))
Kojto 99:dbbf35b96557 75 #define IS_ETH_WATCHDOG(CMD) (((CMD) == ETH_WATCHDOG_ENABLE) || \
Kojto 99:dbbf35b96557 76 ((CMD) == ETH_WATCHDOG_DISABLE))
Kojto 99:dbbf35b96557 77 #define IS_ETH_JABBER(CMD) (((CMD) == ETH_JABBER_ENABLE) || \
Kojto 99:dbbf35b96557 78 ((CMD) == ETH_JABBER_DISABLE))
Kojto 99:dbbf35b96557 79 #define IS_ETH_INTER_FRAME_GAP(GAP) (((GAP) == ETH_INTERFRAMEGAP_96BIT) || \
Kojto 99:dbbf35b96557 80 ((GAP) == ETH_INTERFRAMEGAP_88BIT) || \
Kojto 99:dbbf35b96557 81 ((GAP) == ETH_INTERFRAMEGAP_80BIT) || \
Kojto 99:dbbf35b96557 82 ((GAP) == ETH_INTERFRAMEGAP_72BIT) || \
Kojto 99:dbbf35b96557 83 ((GAP) == ETH_INTERFRAMEGAP_64BIT) || \
Kojto 99:dbbf35b96557 84 ((GAP) == ETH_INTERFRAMEGAP_56BIT) || \
Kojto 99:dbbf35b96557 85 ((GAP) == ETH_INTERFRAMEGAP_48BIT) || \
Kojto 99:dbbf35b96557 86 ((GAP) == ETH_INTERFRAMEGAP_40BIT))
Kojto 99:dbbf35b96557 87 #define IS_ETH_CARRIER_SENSE(CMD) (((CMD) == ETH_CARRIERSENCE_ENABLE) || \
Kojto 99:dbbf35b96557 88 ((CMD) == ETH_CARRIERSENCE_DISABLE))
Kojto 99:dbbf35b96557 89 #define IS_ETH_RECEIVE_OWN(CMD) (((CMD) == ETH_RECEIVEOWN_ENABLE) || \
Kojto 99:dbbf35b96557 90 ((CMD) == ETH_RECEIVEOWN_DISABLE))
Kojto 99:dbbf35b96557 91 #define IS_ETH_LOOPBACK_MODE(CMD) (((CMD) == ETH_LOOPBACKMODE_ENABLE) || \
Kojto 99:dbbf35b96557 92 ((CMD) == ETH_LOOPBACKMODE_DISABLE))
Kojto 99:dbbf35b96557 93 #define IS_ETH_CHECKSUM_OFFLOAD(CMD) (((CMD) == ETH_CHECKSUMOFFLAOD_ENABLE) || \
Kojto 99:dbbf35b96557 94 ((CMD) == ETH_CHECKSUMOFFLAOD_DISABLE))
Kojto 99:dbbf35b96557 95 #define IS_ETH_RETRY_TRANSMISSION(CMD) (((CMD) == ETH_RETRYTRANSMISSION_ENABLE) || \
Kojto 99:dbbf35b96557 96 ((CMD) == ETH_RETRYTRANSMISSION_DISABLE))
Kojto 99:dbbf35b96557 97 #define IS_ETH_AUTOMATIC_PADCRC_STRIP(CMD) (((CMD) == ETH_AUTOMATICPADCRCSTRIP_ENABLE) || \
Kojto 99:dbbf35b96557 98 ((CMD) == ETH_AUTOMATICPADCRCSTRIP_DISABLE))
Kojto 99:dbbf35b96557 99 #define IS_ETH_BACKOFF_LIMIT(LIMIT) (((LIMIT) == ETH_BACKOFFLIMIT_10) || \
Kojto 99:dbbf35b96557 100 ((LIMIT) == ETH_BACKOFFLIMIT_8) || \
Kojto 99:dbbf35b96557 101 ((LIMIT) == ETH_BACKOFFLIMIT_4) || \
Kojto 99:dbbf35b96557 102 ((LIMIT) == ETH_BACKOFFLIMIT_1))
Kojto 99:dbbf35b96557 103 #define IS_ETH_DEFERRAL_CHECK(CMD) (((CMD) == ETH_DEFFERRALCHECK_ENABLE) || \
Kojto 99:dbbf35b96557 104 ((CMD) == ETH_DEFFERRALCHECK_DISABLE))
Kojto 99:dbbf35b96557 105 #define IS_ETH_RECEIVE_ALL(CMD) (((CMD) == ETH_RECEIVEALL_ENABLE) || \
Kojto 99:dbbf35b96557 106 ((CMD) == ETH_RECEIVEAll_DISABLE))
Kojto 99:dbbf35b96557 107 #define IS_ETH_SOURCE_ADDR_FILTER(CMD) (((CMD) == ETH_SOURCEADDRFILTER_NORMAL_ENABLE) || \
Kojto 99:dbbf35b96557 108 ((CMD) == ETH_SOURCEADDRFILTER_INVERSE_ENABLE) || \
Kojto 99:dbbf35b96557 109 ((CMD) == ETH_SOURCEADDRFILTER_DISABLE))
Kojto 99:dbbf35b96557 110 #define IS_ETH_CONTROL_FRAMES(PASS) (((PASS) == ETH_PASSCONTROLFRAMES_BLOCKALL) || \
Kojto 99:dbbf35b96557 111 ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDALL) || \
Kojto 99:dbbf35b96557 112 ((PASS) == ETH_PASSCONTROLFRAMES_FORWARDPASSEDADDRFILTER))
Kojto 99:dbbf35b96557 113 #define IS_ETH_BROADCAST_FRAMES_RECEPTION(CMD) (((CMD) == ETH_BROADCASTFRAMESRECEPTION_ENABLE) || \
Kojto 99:dbbf35b96557 114 ((CMD) == ETH_BROADCASTFRAMESRECEPTION_DISABLE))
Kojto 99:dbbf35b96557 115 #define IS_ETH_DESTINATION_ADDR_FILTER(FILTER) (((FILTER) == ETH_DESTINATIONADDRFILTER_NORMAL) || \
Kojto 99:dbbf35b96557 116 ((FILTER) == ETH_DESTINATIONADDRFILTER_INVERSE))
Kojto 99:dbbf35b96557 117 #define IS_ETH_PROMISCUOUS_MODE(CMD) (((CMD) == ETH_PROMISCUOUS_MODE_ENABLE) || \
Kojto 99:dbbf35b96557 118 ((CMD) == ETH_PROMISCUOUS_MODE_DISABLE))
Kojto 99:dbbf35b96557 119 #define IS_ETH_MULTICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECTHASHTABLE) || \
Kojto 99:dbbf35b96557 120 ((FILTER) == ETH_MULTICASTFRAMESFILTER_HASHTABLE) || \
Kojto 99:dbbf35b96557 121 ((FILTER) == ETH_MULTICASTFRAMESFILTER_PERFECT) || \
Kojto 99:dbbf35b96557 122 ((FILTER) == ETH_MULTICASTFRAMESFILTER_NONE))
Kojto 99:dbbf35b96557 123 #define IS_ETH_UNICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECTHASHTABLE) || \
Kojto 99:dbbf35b96557 124 ((FILTER) == ETH_UNICASTFRAMESFILTER_HASHTABLE) || \
Kojto 99:dbbf35b96557 125 ((FILTER) == ETH_UNICASTFRAMESFILTER_PERFECT))
Kojto 99:dbbf35b96557 126 #define IS_ETH_PAUSE_TIME(TIME) ((TIME) <= 0xFFFF)
Kojto 99:dbbf35b96557 127 #define IS_ETH_ZEROQUANTA_PAUSE(CMD) (((CMD) == ETH_ZEROQUANTAPAUSE_ENABLE) || \
Kojto 99:dbbf35b96557 128 ((CMD) == ETH_ZEROQUANTAPAUSE_DISABLE))
Kojto 99:dbbf35b96557 129 #define IS_ETH_PAUSE_LOW_THRESHOLD(THRESHOLD) (((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS4) || \
Kojto 99:dbbf35b96557 130 ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS28) || \
Kojto 99:dbbf35b96557 131 ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS144) || \
Kojto 99:dbbf35b96557 132 ((THRESHOLD) == ETH_PAUSELOWTHRESHOLD_MINUS256))
Kojto 99:dbbf35b96557 133 #define IS_ETH_UNICAST_PAUSE_FRAME_DETECT(CMD) (((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_ENABLE) || \
Kojto 99:dbbf35b96557 134 ((CMD) == ETH_UNICASTPAUSEFRAMEDETECT_DISABLE))
Kojto 99:dbbf35b96557 135 #define IS_ETH_RECEIVE_FLOWCONTROL(CMD) (((CMD) == ETH_RECEIVEFLOWCONTROL_ENABLE) || \
Kojto 99:dbbf35b96557 136 ((CMD) == ETH_RECEIVEFLOWCONTROL_DISABLE))
Kojto 99:dbbf35b96557 137 #define IS_ETH_TRANSMIT_FLOWCONTROL(CMD) (((CMD) == ETH_TRANSMITFLOWCONTROL_ENABLE) || \
Kojto 99:dbbf35b96557 138 ((CMD) == ETH_TRANSMITFLOWCONTROL_DISABLE))
Kojto 99:dbbf35b96557 139 #define IS_ETH_VLAN_TAG_COMPARISON(COMPARISON) (((COMPARISON) == ETH_VLANTAGCOMPARISON_12BIT) || \
Kojto 99:dbbf35b96557 140 ((COMPARISON) == ETH_VLANTAGCOMPARISON_16BIT))
Kojto 99:dbbf35b96557 141 #define IS_ETH_VLAN_TAG_IDENTIFIER(IDENTIFIER) ((IDENTIFIER) <= 0xFFFF)
Kojto 99:dbbf35b96557 142 #define IS_ETH_MAC_ADDRESS0123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS0) || \
Kojto 99:dbbf35b96557 143 ((ADDRESS) == ETH_MAC_ADDRESS1) || \
Kojto 99:dbbf35b96557 144 ((ADDRESS) == ETH_MAC_ADDRESS2) || \
Kojto 99:dbbf35b96557 145 ((ADDRESS) == ETH_MAC_ADDRESS3))
Kojto 99:dbbf35b96557 146 #define IS_ETH_MAC_ADDRESS123(ADDRESS) (((ADDRESS) == ETH_MAC_ADDRESS1) || \
Kojto 99:dbbf35b96557 147 ((ADDRESS) == ETH_MAC_ADDRESS2) || \
Kojto 99:dbbf35b96557 148 ((ADDRESS) == ETH_MAC_ADDRESS3))
Kojto 99:dbbf35b96557 149 #define IS_ETH_MAC_ADDRESS_FILTER(FILTER) (((FILTER) == ETH_MAC_ADDRESSFILTER_SA) || \
Kojto 99:dbbf35b96557 150 ((FILTER) == ETH_MAC_ADDRESSFILTER_DA))
Kojto 99:dbbf35b96557 151 #define IS_ETH_MAC_ADDRESS_MASK(MASK) (((MASK) == ETH_MAC_ADDRESSMASK_BYTE6) || \
Kojto 99:dbbf35b96557 152 ((MASK) == ETH_MAC_ADDRESSMASK_BYTE5) || \
Kojto 99:dbbf35b96557 153 ((MASK) == ETH_MAC_ADDRESSMASK_BYTE4) || \
Kojto 99:dbbf35b96557 154 ((MASK) == ETH_MAC_ADDRESSMASK_BYTE3) || \
Kojto 99:dbbf35b96557 155 ((MASK) == ETH_MAC_ADDRESSMASK_BYTE2) || \
Kojto 99:dbbf35b96557 156 ((MASK) == ETH_MAC_ADDRESSMASK_BYTE1))
Kojto 99:dbbf35b96557 157 #define IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(CMD) (((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE) || \
Kojto 99:dbbf35b96557 158 ((CMD) == ETH_DROPTCPIPCHECKSUMERRORFRAME_DISABLE))
Kojto 99:dbbf35b96557 159 #define IS_ETH_RECEIVE_STORE_FORWARD(CMD) (((CMD) == ETH_RECEIVESTOREFORWARD_ENABLE) || \
Kojto 99:dbbf35b96557 160 ((CMD) == ETH_RECEIVESTOREFORWARD_DISABLE))
Kojto 99:dbbf35b96557 161 #define IS_ETH_FLUSH_RECEIVE_FRAME(CMD) (((CMD) == ETH_FLUSHRECEIVEDFRAME_ENABLE) || \
Kojto 99:dbbf35b96557 162 ((CMD) == ETH_FLUSHRECEIVEDFRAME_DISABLE))
Kojto 99:dbbf35b96557 163 #define IS_ETH_TRANSMIT_STORE_FORWARD(CMD) (((CMD) == ETH_TRANSMITSTOREFORWARD_ENABLE) || \
Kojto 99:dbbf35b96557 164 ((CMD) == ETH_TRANSMITSTOREFORWARD_DISABLE))
Kojto 99:dbbf35b96557 165 #define IS_ETH_TRANSMIT_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_64BYTES) || \
Kojto 99:dbbf35b96557 166 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_128BYTES) || \
Kojto 99:dbbf35b96557 167 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_192BYTES) || \
Kojto 99:dbbf35b96557 168 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_256BYTES) || \
Kojto 99:dbbf35b96557 169 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_40BYTES) || \
Kojto 99:dbbf35b96557 170 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_32BYTES) || \
Kojto 99:dbbf35b96557 171 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_24BYTES) || \
Kojto 99:dbbf35b96557 172 ((THRESHOLD) == ETH_TRANSMITTHRESHOLDCONTROL_16BYTES))
Kojto 99:dbbf35b96557 173 #define IS_ETH_FORWARD_ERROR_FRAMES(CMD) (((CMD) == ETH_FORWARDERRORFRAMES_ENABLE) || \
Kojto 99:dbbf35b96557 174 ((CMD) == ETH_FORWARDERRORFRAMES_DISABLE))
Kojto 99:dbbf35b96557 175 #define IS_ETH_FORWARD_UNDERSIZED_GOOD_FRAMES(CMD) (((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_ENABLE) || \
Kojto 99:dbbf35b96557 176 ((CMD) == ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE))
Kojto 99:dbbf35b96557 177 #define IS_ETH_RECEIVE_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES) || \
Kojto 99:dbbf35b96557 178 ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_32BYTES) || \
Kojto 99:dbbf35b96557 179 ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_96BYTES) || \
Kojto 99:dbbf35b96557 180 ((THRESHOLD) == ETH_RECEIVEDTHRESHOLDCONTROL_128BYTES))
Kojto 99:dbbf35b96557 181 #define IS_ETH_SECOND_FRAME_OPERATE(CMD) (((CMD) == ETH_SECONDFRAMEOPERARTE_ENABLE) || \
Kojto 99:dbbf35b96557 182 ((CMD) == ETH_SECONDFRAMEOPERARTE_DISABLE))
Kojto 99:dbbf35b96557 183 #define IS_ETH_ADDRESS_ALIGNED_BEATS(CMD) (((CMD) == ETH_ADDRESSALIGNEDBEATS_ENABLE) || \
Kojto 99:dbbf35b96557 184 ((CMD) == ETH_ADDRESSALIGNEDBEATS_DISABLE))
Kojto 99:dbbf35b96557 185 #define IS_ETH_FIXED_BURST(CMD) (((CMD) == ETH_FIXEDBURST_ENABLE) || \
Kojto 99:dbbf35b96557 186 ((CMD) == ETH_FIXEDBURST_DISABLE))
Kojto 99:dbbf35b96557 187 #define IS_ETH_RXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_RXDMABURSTLENGTH_1BEAT) || \
Kojto 99:dbbf35b96557 188 ((LENGTH) == ETH_RXDMABURSTLENGTH_2BEAT) || \
Kojto 99:dbbf35b96557 189 ((LENGTH) == ETH_RXDMABURSTLENGTH_4BEAT) || \
Kojto 99:dbbf35b96557 190 ((LENGTH) == ETH_RXDMABURSTLENGTH_8BEAT) || \
Kojto 99:dbbf35b96557 191 ((LENGTH) == ETH_RXDMABURSTLENGTH_16BEAT) || \
Kojto 99:dbbf35b96557 192 ((LENGTH) == ETH_RXDMABURSTLENGTH_32BEAT) || \
Kojto 99:dbbf35b96557 193 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_4BEAT) || \
Kojto 99:dbbf35b96557 194 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_8BEAT) || \
Kojto 99:dbbf35b96557 195 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_16BEAT) || \
Kojto 99:dbbf35b96557 196 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_32BEAT) || \
Kojto 99:dbbf35b96557 197 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_64BEAT) || \
Kojto 99:dbbf35b96557 198 ((LENGTH) == ETH_RXDMABURSTLENGTH_4XPBL_128BEAT))
Kojto 99:dbbf35b96557 199 #define IS_ETH_TXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_TXDMABURSTLENGTH_1BEAT) || \
Kojto 99:dbbf35b96557 200 ((LENGTH) == ETH_TXDMABURSTLENGTH_2BEAT) || \
Kojto 99:dbbf35b96557 201 ((LENGTH) == ETH_TXDMABURSTLENGTH_4BEAT) || \
Kojto 99:dbbf35b96557 202 ((LENGTH) == ETH_TXDMABURSTLENGTH_8BEAT) || \
Kojto 99:dbbf35b96557 203 ((LENGTH) == ETH_TXDMABURSTLENGTH_16BEAT) || \
Kojto 99:dbbf35b96557 204 ((LENGTH) == ETH_TXDMABURSTLENGTH_32BEAT) || \
Kojto 99:dbbf35b96557 205 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_4BEAT) || \
Kojto 99:dbbf35b96557 206 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_8BEAT) || \
Kojto 99:dbbf35b96557 207 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_16BEAT) || \
Kojto 99:dbbf35b96557 208 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_32BEAT) || \
Kojto 99:dbbf35b96557 209 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_64BEAT) || \
Kojto 99:dbbf35b96557 210 ((LENGTH) == ETH_TXDMABURSTLENGTH_4XPBL_128BEAT))
Kojto 99:dbbf35b96557 211 #define IS_ETH_DMA_DESC_SKIP_LENGTH(LENGTH) ((LENGTH) <= 0x1F)
Kojto 99:dbbf35b96557 212 #define IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(RATIO) (((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1) || \
Kojto 99:dbbf35b96557 213 ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_2_1) || \
Kojto 99:dbbf35b96557 214 ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_3_1) || \
Kojto 99:dbbf35b96557 215 ((RATIO) == ETH_DMAARBITRATION_ROUNDROBIN_RXTX_4_1) || \
Kojto 99:dbbf35b96557 216 ((RATIO) == ETH_DMAARBITRATION_RXPRIORTX))
Kojto 99:dbbf35b96557 217 #define IS_ETH_DMATXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMATXDESC_OWN) || \
Kojto 99:dbbf35b96557 218 ((FLAG) == ETH_DMATXDESC_IC) || \
Kojto 99:dbbf35b96557 219 ((FLAG) == ETH_DMATXDESC_LS) || \
Kojto 99:dbbf35b96557 220 ((FLAG) == ETH_DMATXDESC_FS) || \
Kojto 99:dbbf35b96557 221 ((FLAG) == ETH_DMATXDESC_DC) || \
Kojto 99:dbbf35b96557 222 ((FLAG) == ETH_DMATXDESC_DP) || \
Kojto 99:dbbf35b96557 223 ((FLAG) == ETH_DMATXDESC_TTSE) || \
Kojto 99:dbbf35b96557 224 ((FLAG) == ETH_DMATXDESC_TER) || \
Kojto 99:dbbf35b96557 225 ((FLAG) == ETH_DMATXDESC_TCH) || \
Kojto 99:dbbf35b96557 226 ((FLAG) == ETH_DMATXDESC_TTSS) || \
Kojto 99:dbbf35b96557 227 ((FLAG) == ETH_DMATXDESC_IHE) || \
Kojto 99:dbbf35b96557 228 ((FLAG) == ETH_DMATXDESC_ES) || \
Kojto 99:dbbf35b96557 229 ((FLAG) == ETH_DMATXDESC_JT) || \
Kojto 99:dbbf35b96557 230 ((FLAG) == ETH_DMATXDESC_FF) || \
Kojto 99:dbbf35b96557 231 ((FLAG) == ETH_DMATXDESC_PCE) || \
Kojto 99:dbbf35b96557 232 ((FLAG) == ETH_DMATXDESC_LCA) || \
Kojto 99:dbbf35b96557 233 ((FLAG) == ETH_DMATXDESC_NC) || \
Kojto 99:dbbf35b96557 234 ((FLAG) == ETH_DMATXDESC_LCO) || \
Kojto 99:dbbf35b96557 235 ((FLAG) == ETH_DMATXDESC_EC) || \
Kojto 99:dbbf35b96557 236 ((FLAG) == ETH_DMATXDESC_VF) || \
Kojto 99:dbbf35b96557 237 ((FLAG) == ETH_DMATXDESC_CC) || \
Kojto 99:dbbf35b96557 238 ((FLAG) == ETH_DMATXDESC_ED) || \
Kojto 99:dbbf35b96557 239 ((FLAG) == ETH_DMATXDESC_UF) || \
Kojto 99:dbbf35b96557 240 ((FLAG) == ETH_DMATXDESC_DB))
Kojto 99:dbbf35b96557 241 #define IS_ETH_DMA_TXDESC_SEGMENT(SEGMENT) (((SEGMENT) == ETH_DMATXDESC_LASTSEGMENTS) || \
Kojto 99:dbbf35b96557 242 ((SEGMENT) == ETH_DMATXDESC_FIRSTSEGMENT))
Kojto 99:dbbf35b96557 243 #define IS_ETH_DMA_TXDESC_CHECKSUM(CHECKSUM) (((CHECKSUM) == ETH_DMATXDESC_CHECKSUMBYPASS) || \
Kojto 99:dbbf35b96557 244 ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMIPV4HEADER) || \
Kojto 99:dbbf35b96557 245 ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT) || \
Kojto 99:dbbf35b96557 246 ((CHECKSUM) == ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL))
Kojto 99:dbbf35b96557 247 #define IS_ETH_DMATXDESC_BUFFER_SIZE(SIZE) ((SIZE) <= 0x1FFF)
Kojto 99:dbbf35b96557 248 #define IS_ETH_DMARXDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMARXDESC_OWN) || \
Kojto 99:dbbf35b96557 249 ((FLAG) == ETH_DMARXDESC_AFM) || \
Kojto 99:dbbf35b96557 250 ((FLAG) == ETH_DMARXDESC_ES) || \
Kojto 99:dbbf35b96557 251 ((FLAG) == ETH_DMARXDESC_DE) || \
Kojto 99:dbbf35b96557 252 ((FLAG) == ETH_DMARXDESC_SAF) || \
Kojto 99:dbbf35b96557 253 ((FLAG) == ETH_DMARXDESC_LE) || \
Kojto 99:dbbf35b96557 254 ((FLAG) == ETH_DMARXDESC_OE) || \
Kojto 99:dbbf35b96557 255 ((FLAG) == ETH_DMARXDESC_VLAN) || \
Kojto 99:dbbf35b96557 256 ((FLAG) == ETH_DMARXDESC_FS) || \
Kojto 99:dbbf35b96557 257 ((FLAG) == ETH_DMARXDESC_LS) || \
Kojto 99:dbbf35b96557 258 ((FLAG) == ETH_DMARXDESC_IPV4HCE) || \
Kojto 99:dbbf35b96557 259 ((FLAG) == ETH_DMARXDESC_LC) || \
Kojto 99:dbbf35b96557 260 ((FLAG) == ETH_DMARXDESC_FT) || \
Kojto 99:dbbf35b96557 261 ((FLAG) == ETH_DMARXDESC_RWT) || \
Kojto 99:dbbf35b96557 262 ((FLAG) == ETH_DMARXDESC_RE) || \
Kojto 99:dbbf35b96557 263 ((FLAG) == ETH_DMARXDESC_DBE) || \
Kojto 99:dbbf35b96557 264 ((FLAG) == ETH_DMARXDESC_CE) || \
Kojto 99:dbbf35b96557 265 ((FLAG) == ETH_DMARXDESC_MAMPCE))
Kojto 99:dbbf35b96557 266 #define IS_ETH_DMA_RXDESC_BUFFER(BUFFER) (((BUFFER) == ETH_DMARXDESC_BUFFER1) || \
Kojto 99:dbbf35b96557 267 ((BUFFER) == ETH_DMARXDESC_BUFFER2))
Kojto 99:dbbf35b96557 268 #define IS_ETH_PMT_GET_FLAG(FLAG) (((FLAG) == ETH_PMT_FLAG_WUFR) || \
Kojto 99:dbbf35b96557 269 ((FLAG) == ETH_PMT_FLAG_MPR))
Kojto 99:dbbf35b96557 270 #define IS_ETH_DMA_FLAG(FLAG) ((((FLAG) & (uint32_t)0xC7FE1800) == 0x00) && ((FLAG) != 0x00))
Kojto 99:dbbf35b96557 271 #define IS_ETH_DMA_GET_FLAG(FLAG) (((FLAG) == ETH_DMA_FLAG_TST) || ((FLAG) == ETH_DMA_FLAG_PMT) || \
Kojto 99:dbbf35b96557 272 ((FLAG) == ETH_DMA_FLAG_MMC) || ((FLAG) == ETH_DMA_FLAG_DATATRANSFERERROR) || \
Kojto 99:dbbf35b96557 273 ((FLAG) == ETH_DMA_FLAG_READWRITEERROR) || ((FLAG) == ETH_DMA_FLAG_ACCESSERROR) || \
Kojto 99:dbbf35b96557 274 ((FLAG) == ETH_DMA_FLAG_NIS) || ((FLAG) == ETH_DMA_FLAG_AIS) || \
Kojto 99:dbbf35b96557 275 ((FLAG) == ETH_DMA_FLAG_ER) || ((FLAG) == ETH_DMA_FLAG_FBE) || \
Kojto 99:dbbf35b96557 276 ((FLAG) == ETH_DMA_FLAG_ET) || ((FLAG) == ETH_DMA_FLAG_RWT) || \
Kojto 99:dbbf35b96557 277 ((FLAG) == ETH_DMA_FLAG_RPS) || ((FLAG) == ETH_DMA_FLAG_RBU) || \
Kojto 99:dbbf35b96557 278 ((FLAG) == ETH_DMA_FLAG_R) || ((FLAG) == ETH_DMA_FLAG_TU) || \
Kojto 99:dbbf35b96557 279 ((FLAG) == ETH_DMA_FLAG_RO) || ((FLAG) == ETH_DMA_FLAG_TJT) || \
Kojto 99:dbbf35b96557 280 ((FLAG) == ETH_DMA_FLAG_TBU) || ((FLAG) == ETH_DMA_FLAG_TPS) || \
Kojto 99:dbbf35b96557 281 ((FLAG) == ETH_DMA_FLAG_T))
Kojto 99:dbbf35b96557 282 #define IS_ETH_MAC_IT(IT) ((((IT) & (uint32_t)0xFFFFFDF1) == 0x00) && ((IT) != 0x00))
Kojto 99:dbbf35b96557 283 #define IS_ETH_MAC_GET_IT(IT) (((IT) == ETH_MAC_IT_TST) || ((IT) == ETH_MAC_IT_MMCT) || \
Kojto 99:dbbf35b96557 284 ((IT) == ETH_MAC_IT_MMCR) || ((IT) == ETH_MAC_IT_MMC) || \
Kojto 99:dbbf35b96557 285 ((IT) == ETH_MAC_IT_PMT))
Kojto 99:dbbf35b96557 286 #define IS_ETH_MAC_GET_FLAG(FLAG) (((FLAG) == ETH_MAC_FLAG_TST) || ((FLAG) == ETH_MAC_FLAG_MMCT) || \
Kojto 99:dbbf35b96557 287 ((FLAG) == ETH_MAC_FLAG_MMCR) || ((FLAG) == ETH_MAC_FLAG_MMC) || \
Kojto 99:dbbf35b96557 288 ((FLAG) == ETH_MAC_FLAG_PMT))
Kojto 99:dbbf35b96557 289 #define IS_ETH_DMA_IT(IT) ((((IT) & (uint32_t)0xC7FE1800) == 0x00) && ((IT) != 0x00))
Kojto 99:dbbf35b96557 290 #define IS_ETH_DMA_GET_IT(IT) (((IT) == ETH_DMA_IT_TST) || ((IT) == ETH_DMA_IT_PMT) || \
Kojto 99:dbbf35b96557 291 ((IT) == ETH_DMA_IT_MMC) || ((IT) == ETH_DMA_IT_NIS) || \
Kojto 99:dbbf35b96557 292 ((IT) == ETH_DMA_IT_AIS) || ((IT) == ETH_DMA_IT_ER) || \
Kojto 99:dbbf35b96557 293 ((IT) == ETH_DMA_IT_FBE) || ((IT) == ETH_DMA_IT_ET) || \
Kojto 99:dbbf35b96557 294 ((IT) == ETH_DMA_IT_RWT) || ((IT) == ETH_DMA_IT_RPS) || \
Kojto 99:dbbf35b96557 295 ((IT) == ETH_DMA_IT_RBU) || ((IT) == ETH_DMA_IT_R) || \
Kojto 99:dbbf35b96557 296 ((IT) == ETH_DMA_IT_TU) || ((IT) == ETH_DMA_IT_RO) || \
Kojto 99:dbbf35b96557 297 ((IT) == ETH_DMA_IT_TJT) || ((IT) == ETH_DMA_IT_TBU) || \
Kojto 99:dbbf35b96557 298 ((IT) == ETH_DMA_IT_TPS) || ((IT) == ETH_DMA_IT_T))
Kojto 99:dbbf35b96557 299 #define IS_ETH_DMA_GET_OVERFLOW(OVERFLOW) (((OVERFLOW) == ETH_DMA_OVERFLOW_RXFIFOCOUNTER) || \
Kojto 99:dbbf35b96557 300 ((OVERFLOW) == ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER))
Kojto 99:dbbf35b96557 301 #define IS_ETH_MMC_IT(IT) (((((IT) & (uint32_t)0xFFDF3FFF) == 0x00) || (((IT) & (uint32_t)0xEFFDFF9F) == 0x00)) && \
Kojto 99:dbbf35b96557 302 ((IT) != 0x00))
Kojto 99:dbbf35b96557 303 #define IS_ETH_MMC_GET_IT(IT) (((IT) == ETH_MMC_IT_TGF) || ((IT) == ETH_MMC_IT_TGFMSC) || \
Kojto 99:dbbf35b96557 304 ((IT) == ETH_MMC_IT_TGFSC) || ((IT) == ETH_MMC_IT_RGUF) || \
Kojto 99:dbbf35b96557 305 ((IT) == ETH_MMC_IT_RFAE) || ((IT) == ETH_MMC_IT_RFCE))
Kojto 99:dbbf35b96557 306 #define IS_ETH_ENHANCED_DESCRIPTOR_FORMAT(CMD) (((CMD) == ETH_DMAENHANCEDDESCRIPTOR_ENABLE) || \
Kojto 99:dbbf35b96557 307 ((CMD) == ETH_DMAENHANCEDDESCRIPTOR_DISABLE))
Kojto 99:dbbf35b96557 308
Kojto 99:dbbf35b96557 309
Kojto 99:dbbf35b96557 310 /**
Kojto 99:dbbf35b96557 311 * @}
Kojto 99:dbbf35b96557 312 */
Kojto 99:dbbf35b96557 313
Kojto 99:dbbf35b96557 314 /** @addtogroup ETH_Private_Defines
Kojto 99:dbbf35b96557 315 * @{
Kojto 99:dbbf35b96557 316 */
Kojto 99:dbbf35b96557 317 /* Delay to wait when writing to some Ethernet registers */
Kojto 99:dbbf35b96557 318 #define ETH_REG_WRITE_DELAY ((uint32_t)0x00000001)
Kojto 99:dbbf35b96557 319
Kojto 99:dbbf35b96557 320 /* ETHERNET Errors */
Kojto 99:dbbf35b96557 321 #define ETH_SUCCESS ((uint32_t)0)
Kojto 99:dbbf35b96557 322 #define ETH_ERROR ((uint32_t)1)
Kojto 99:dbbf35b96557 323
Kojto 99:dbbf35b96557 324 /* ETHERNET DMA Tx descriptors Collision Count Shift */
Kojto 99:dbbf35b96557 325 #define ETH_DMATXDESC_COLLISION_COUNTSHIFT ((uint32_t)3)
Kojto 99:dbbf35b96557 326
Kojto 99:dbbf35b96557 327 /* ETHERNET DMA Tx descriptors Buffer2 Size Shift */
Kojto 99:dbbf35b96557 328 #define ETH_DMATXDESC_BUFFER2_SIZESHIFT ((uint32_t)16)
Kojto 99:dbbf35b96557 329
Kojto 99:dbbf35b96557 330 /* ETHERNET DMA Rx descriptors Frame Length Shift */
Kojto 99:dbbf35b96557 331 #define ETH_DMARXDESC_FRAME_LENGTHSHIFT ((uint32_t)16)
Kojto 99:dbbf35b96557 332
Kojto 99:dbbf35b96557 333 /* ETHERNET DMA Rx descriptors Buffer2 Size Shift */
Kojto 99:dbbf35b96557 334 #define ETH_DMARXDESC_BUFFER2_SIZESHIFT ((uint32_t)16)
Kojto 99:dbbf35b96557 335
Kojto 99:dbbf35b96557 336 /* ETHERNET DMA Rx descriptors Frame length Shift */
Kojto 99:dbbf35b96557 337 #define ETH_DMARXDESC_FRAMELENGTHSHIFT ((uint32_t)16)
Kojto 99:dbbf35b96557 338
Kojto 99:dbbf35b96557 339 /* ETHERNET MAC address offsets */
Kojto 99:dbbf35b96557 340 #define ETH_MAC_ADDR_HBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x40) /* ETHERNET MAC address high offset */
Kojto 99:dbbf35b96557 341 #define ETH_MAC_ADDR_LBASE (uint32_t)(ETH_MAC_BASE + (uint32_t)0x44) /* ETHERNET MAC address low offset */
Kojto 99:dbbf35b96557 342
Kojto 99:dbbf35b96557 343 /* ETHERNET MACMIIAR register Mask */
Kojto 99:dbbf35b96557 344 #define ETH_MACMIIAR_CR_MASK ((uint32_t)0xFFFFFFE3)
Kojto 99:dbbf35b96557 345
Kojto 99:dbbf35b96557 346 /* ETHERNET MACCR register Mask */
Kojto 99:dbbf35b96557 347 #define ETH_MACCR_CLEAR_MASK ((uint32_t)0xFF20810F)
Kojto 99:dbbf35b96557 348
Kojto 99:dbbf35b96557 349 /* ETHERNET MACFCR register Mask */
Kojto 99:dbbf35b96557 350 #define ETH_MACFCR_CLEAR_MASK ((uint32_t)0x0000FF41)
Kojto 99:dbbf35b96557 351
Kojto 99:dbbf35b96557 352 /* ETHERNET DMAOMR register Mask */
Kojto 99:dbbf35b96557 353 #define ETH_DMAOMR_CLEAR_MASK ((uint32_t)0xF8DE3F23)
Kojto 99:dbbf35b96557 354
Kojto 99:dbbf35b96557 355 /* ETHERNET Remote Wake-up frame register length */
Kojto 99:dbbf35b96557 356 #define ETH_WAKEUP_REGISTER_LENGTH 8
Kojto 99:dbbf35b96557 357
Kojto 99:dbbf35b96557 358 /* ETHERNET Missed frames counter Shift */
Kojto 99:dbbf35b96557 359 #define ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT 17
Kojto 99:dbbf35b96557 360 /**
Kojto 99:dbbf35b96557 361 * @}
Kojto 99:dbbf35b96557 362 */
bogdanm 86:04dd9b1680ae 363
bogdanm 86:04dd9b1680ae 364 /* Exported types ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 365 /** @defgroup ETH_Exported_Types ETH Exported Types
Kojto 99:dbbf35b96557 366 * @{
Kojto 99:dbbf35b96557 367 */
bogdanm 86:04dd9b1680ae 368
bogdanm 86:04dd9b1680ae 369 /**
bogdanm 86:04dd9b1680ae 370 * @brief HAL State structures definition
bogdanm 86:04dd9b1680ae 371 */
bogdanm 86:04dd9b1680ae 372 typedef enum
bogdanm 86:04dd9b1680ae 373 {
bogdanm 86:04dd9b1680ae 374 HAL_ETH_STATE_RESET = 0x00, /*!< Peripheral not yet Initialized or disabled */
bogdanm 86:04dd9b1680ae 375 HAL_ETH_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
bogdanm 86:04dd9b1680ae 376 HAL_ETH_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
bogdanm 86:04dd9b1680ae 377 HAL_ETH_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
bogdanm 86:04dd9b1680ae 378 HAL_ETH_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
bogdanm 86:04dd9b1680ae 379 HAL_ETH_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
bogdanm 86:04dd9b1680ae 380 HAL_ETH_STATE_BUSY_WR = 0x42, /*!< Write process is ongoing */
bogdanm 86:04dd9b1680ae 381 HAL_ETH_STATE_BUSY_RD = 0x82, /*!< Read process is ongoing */
bogdanm 86:04dd9b1680ae 382 HAL_ETH_STATE_TIMEOUT = 0x03, /*!< Timeout state */
bogdanm 86:04dd9b1680ae 383 HAL_ETH_STATE_ERROR = 0x04 /*!< Reception process is ongoing */
bogdanm 86:04dd9b1680ae 384 }HAL_ETH_StateTypeDef;
bogdanm 86:04dd9b1680ae 385
bogdanm 86:04dd9b1680ae 386 /**
bogdanm 86:04dd9b1680ae 387 * @brief ETH Init Structure definition
bogdanm 86:04dd9b1680ae 388 */
bogdanm 86:04dd9b1680ae 389
bogdanm 86:04dd9b1680ae 390 typedef struct
bogdanm 86:04dd9b1680ae 391 {
bogdanm 86:04dd9b1680ae 392 uint32_t AutoNegotiation; /*!< Selects or not the AutoNegotiation mode for the external PHY
bogdanm 86:04dd9b1680ae 393 The AutoNegotiation allows an automatic setting of the Speed (10/100Mbps)
bogdanm 86:04dd9b1680ae 394 and the mode (half/full-duplex).
bogdanm 86:04dd9b1680ae 395 This parameter can be a value of @ref ETH_AutoNegotiation */
bogdanm 86:04dd9b1680ae 396
bogdanm 86:04dd9b1680ae 397 uint32_t Speed; /*!< Sets the Ethernet speed: 10/100 Mbps.
bogdanm 86:04dd9b1680ae 398 This parameter can be a value of @ref ETH_Speed */
bogdanm 86:04dd9b1680ae 399
bogdanm 86:04dd9b1680ae 400 uint32_t DuplexMode; /*!< Selects the MAC duplex mode: Half-Duplex or Full-Duplex mode
bogdanm 86:04dd9b1680ae 401 This parameter can be a value of @ref ETH_Duplex_Mode */
bogdanm 86:04dd9b1680ae 402
bogdanm 86:04dd9b1680ae 403 uint16_t PhyAddress; /*!< Ethernet PHY address.
bogdanm 86:04dd9b1680ae 404 This parameter must be a number between Min_Data = 0 and Max_Data = 32 */
bogdanm 86:04dd9b1680ae 405
bogdanm 86:04dd9b1680ae 406 uint8_t *MACAddr; /*!< MAC Address of used Hardware: must be pointer on an array of 6 bytes */
bogdanm 86:04dd9b1680ae 407
bogdanm 86:04dd9b1680ae 408 uint32_t RxMode; /*!< Selects the Ethernet Rx mode: Polling mode, Interrupt mode.
bogdanm 86:04dd9b1680ae 409 This parameter can be a value of @ref ETH_Rx_Mode */
bogdanm 86:04dd9b1680ae 410
bogdanm 86:04dd9b1680ae 411 uint32_t ChecksumMode; /*!< Selects if the checksum is check by hardware or by software.
bogdanm 86:04dd9b1680ae 412 This parameter can be a value of @ref ETH_Checksum_Mode */
bogdanm 86:04dd9b1680ae 413
bogdanm 86:04dd9b1680ae 414 uint32_t MediaInterface ; /*!< Selects the media-independent interface or the reduced media-independent interface.
bogdanm 86:04dd9b1680ae 415 This parameter can be a value of @ref ETH_Media_Interface */
bogdanm 86:04dd9b1680ae 416
bogdanm 86:04dd9b1680ae 417 } ETH_InitTypeDef;
bogdanm 86:04dd9b1680ae 418
bogdanm 86:04dd9b1680ae 419
bogdanm 86:04dd9b1680ae 420 /**
bogdanm 86:04dd9b1680ae 421 * @brief ETH MAC Configuration Structure definition
bogdanm 86:04dd9b1680ae 422 */
bogdanm 86:04dd9b1680ae 423
bogdanm 86:04dd9b1680ae 424 typedef struct
bogdanm 86:04dd9b1680ae 425 {
bogdanm 86:04dd9b1680ae 426 uint32_t Watchdog; /*!< Selects or not the Watchdog timer
bogdanm 86:04dd9b1680ae 427 When enabled, the MAC allows no more then 2048 bytes to be received.
bogdanm 86:04dd9b1680ae 428 When disabled, the MAC can receive up to 16384 bytes.
Kojto 99:dbbf35b96557 429 This parameter can be a value of @ref ETH_Watchdog */
bogdanm 86:04dd9b1680ae 430
bogdanm 86:04dd9b1680ae 431 uint32_t Jabber; /*!< Selects or not Jabber timer
bogdanm 86:04dd9b1680ae 432 When enabled, the MAC allows no more then 2048 bytes to be sent.
bogdanm 86:04dd9b1680ae 433 When disabled, the MAC can send up to 16384 bytes.
bogdanm 86:04dd9b1680ae 434 This parameter can be a value of @ref ETH_Jabber */
bogdanm 86:04dd9b1680ae 435
bogdanm 86:04dd9b1680ae 436 uint32_t InterFrameGap; /*!< Selects the minimum IFG between frames during transmission.
bogdanm 86:04dd9b1680ae 437 This parameter can be a value of @ref ETH_Inter_Frame_Gap */
bogdanm 86:04dd9b1680ae 438
bogdanm 86:04dd9b1680ae 439 uint32_t CarrierSense; /*!< Selects or not the Carrier Sense.
bogdanm 86:04dd9b1680ae 440 This parameter can be a value of @ref ETH_Carrier_Sense */
bogdanm 86:04dd9b1680ae 441
bogdanm 86:04dd9b1680ae 442 uint32_t ReceiveOwn; /*!< Selects or not the ReceiveOwn,
bogdanm 86:04dd9b1680ae 443 ReceiveOwn allows the reception of frames when the TX_EN signal is asserted
bogdanm 86:04dd9b1680ae 444 in Half-Duplex mode.
bogdanm 86:04dd9b1680ae 445 This parameter can be a value of @ref ETH_Receive_Own */
bogdanm 86:04dd9b1680ae 446
bogdanm 86:04dd9b1680ae 447 uint32_t LoopbackMode; /*!< Selects or not the internal MAC MII Loopback mode.
bogdanm 86:04dd9b1680ae 448 This parameter can be a value of @ref ETH_Loop_Back_Mode */
bogdanm 86:04dd9b1680ae 449
bogdanm 86:04dd9b1680ae 450 uint32_t ChecksumOffload; /*!< Selects or not the IPv4 checksum checking for received frame payloads' TCP/UDP/ICMP headers.
bogdanm 86:04dd9b1680ae 451 This parameter can be a value of @ref ETH_Checksum_Offload */
bogdanm 86:04dd9b1680ae 452
bogdanm 86:04dd9b1680ae 453 uint32_t RetryTransmission; /*!< Selects or not the MAC attempt retries transmission, based on the settings of BL,
bogdanm 86:04dd9b1680ae 454 when a collision occurs (Half-Duplex mode).
bogdanm 86:04dd9b1680ae 455 This parameter can be a value of @ref ETH_Retry_Transmission */
bogdanm 86:04dd9b1680ae 456
bogdanm 86:04dd9b1680ae 457 uint32_t AutomaticPadCRCStrip; /*!< Selects or not the Automatic MAC Pad/CRC Stripping.
bogdanm 86:04dd9b1680ae 458 This parameter can be a value of @ref ETH_Automatic_Pad_CRC_Strip */
bogdanm 86:04dd9b1680ae 459
bogdanm 86:04dd9b1680ae 460 uint32_t BackOffLimit; /*!< Selects the BackOff limit value.
bogdanm 86:04dd9b1680ae 461 This parameter can be a value of @ref ETH_Back_Off_Limit */
bogdanm 86:04dd9b1680ae 462
bogdanm 86:04dd9b1680ae 463 uint32_t DeferralCheck; /*!< Selects or not the deferral check function (Half-Duplex mode).
bogdanm 86:04dd9b1680ae 464 This parameter can be a value of @ref ETH_Deferral_Check */
bogdanm 86:04dd9b1680ae 465
bogdanm 86:04dd9b1680ae 466 uint32_t ReceiveAll; /*!< Selects or not all frames reception by the MAC (No filtering).
bogdanm 86:04dd9b1680ae 467 This parameter can be a value of @ref ETH_Receive_All */
bogdanm 86:04dd9b1680ae 468
bogdanm 86:04dd9b1680ae 469 uint32_t SourceAddrFilter; /*!< Selects the Source Address Filter mode.
bogdanm 86:04dd9b1680ae 470 This parameter can be a value of @ref ETH_Source_Addr_Filter */
bogdanm 86:04dd9b1680ae 471
bogdanm 86:04dd9b1680ae 472 uint32_t PassControlFrames; /*!< Sets the forwarding mode of the control frames (including unicast and multicast PAUSE frames)
bogdanm 86:04dd9b1680ae 473 This parameter can be a value of @ref ETH_Pass_Control_Frames */
bogdanm 86:04dd9b1680ae 474
bogdanm 86:04dd9b1680ae 475 uint32_t BroadcastFramesReception; /*!< Selects or not the reception of Broadcast Frames.
bogdanm 86:04dd9b1680ae 476 This parameter can be a value of @ref ETH_Broadcast_Frames_Reception */
bogdanm 86:04dd9b1680ae 477
bogdanm 86:04dd9b1680ae 478 uint32_t DestinationAddrFilter; /*!< Sets the destination filter mode for both unicast and multicast frames.
bogdanm 86:04dd9b1680ae 479 This parameter can be a value of @ref ETH_Destination_Addr_Filter */
bogdanm 86:04dd9b1680ae 480
bogdanm 86:04dd9b1680ae 481 uint32_t PromiscuousMode; /*!< Selects or not the Promiscuous Mode
bogdanm 86:04dd9b1680ae 482 This parameter can be a value of @ref ETH_Promiscuous_Mode */
bogdanm 86:04dd9b1680ae 483
bogdanm 86:04dd9b1680ae 484 uint32_t MulticastFramesFilter; /*!< Selects the Multicast Frames filter mode: None/HashTableFilter/PerfectFilter/PerfectHashTableFilter.
bogdanm 86:04dd9b1680ae 485 This parameter can be a value of @ref ETH_Multicast_Frames_Filter */
bogdanm 86:04dd9b1680ae 486
bogdanm 86:04dd9b1680ae 487 uint32_t UnicastFramesFilter; /*!< Selects the Unicast Frames filter mode: HashTableFilter/PerfectFilter/PerfectHashTableFilter.
bogdanm 86:04dd9b1680ae 488 This parameter can be a value of @ref ETH_Unicast_Frames_Filter */
bogdanm 86:04dd9b1680ae 489
bogdanm 86:04dd9b1680ae 490 uint32_t HashTableHigh; /*!< This field holds the higher 32 bits of Hash table.
bogdanm 86:04dd9b1680ae 491 This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */
bogdanm 86:04dd9b1680ae 492
bogdanm 86:04dd9b1680ae 493 uint32_t HashTableLow; /*!< This field holds the lower 32 bits of Hash table.
bogdanm 86:04dd9b1680ae 494 This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */
bogdanm 86:04dd9b1680ae 495
bogdanm 86:04dd9b1680ae 496 uint32_t PauseTime; /*!< This field holds the value to be used in the Pause Time field in the transmit control frame.
bogdanm 86:04dd9b1680ae 497 This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */
bogdanm 86:04dd9b1680ae 498
bogdanm 86:04dd9b1680ae 499 uint32_t ZeroQuantaPause; /*!< Selects or not the automatic generation of Zero-Quanta Pause Control frames.
bogdanm 86:04dd9b1680ae 500 This parameter can be a value of @ref ETH_Zero_Quanta_Pause */
bogdanm 86:04dd9b1680ae 501
bogdanm 86:04dd9b1680ae 502 uint32_t PauseLowThreshold; /*!< This field configures the threshold of the PAUSE to be checked for
bogdanm 86:04dd9b1680ae 503 automatic retransmission of PAUSE Frame.
bogdanm 86:04dd9b1680ae 504 This parameter can be a value of @ref ETH_Pause_Low_Threshold */
bogdanm 86:04dd9b1680ae 505
bogdanm 86:04dd9b1680ae 506 uint32_t UnicastPauseFrameDetect; /*!< Selects or not the MAC detection of the Pause frames (with MAC Address0
bogdanm 86:04dd9b1680ae 507 unicast address and unique multicast address).
bogdanm 86:04dd9b1680ae 508 This parameter can be a value of @ref ETH_Unicast_Pause_Frame_Detect */
bogdanm 86:04dd9b1680ae 509
bogdanm 86:04dd9b1680ae 510 uint32_t ReceiveFlowControl; /*!< Enables or disables the MAC to decode the received Pause frame and
bogdanm 86:04dd9b1680ae 511 disable its transmitter for a specified time (Pause Time)
bogdanm 86:04dd9b1680ae 512 This parameter can be a value of @ref ETH_Receive_Flow_Control */
bogdanm 86:04dd9b1680ae 513
bogdanm 86:04dd9b1680ae 514 uint32_t TransmitFlowControl; /*!< Enables or disables the MAC to transmit Pause frames (Full-Duplex mode)
bogdanm 86:04dd9b1680ae 515 or the MAC back-pressure operation (Half-Duplex mode)
bogdanm 86:04dd9b1680ae 516 This parameter can be a value of @ref ETH_Transmit_Flow_Control */
bogdanm 86:04dd9b1680ae 517
bogdanm 86:04dd9b1680ae 518 uint32_t VLANTagComparison; /*!< Selects the 12-bit VLAN identifier or the complete 16-bit VLAN tag for
bogdanm 86:04dd9b1680ae 519 comparison and filtering.
bogdanm 86:04dd9b1680ae 520 This parameter can be a value of @ref ETH_VLAN_Tag_Comparison */
bogdanm 86:04dd9b1680ae 521
bogdanm 86:04dd9b1680ae 522 uint32_t VLANTagIdentifier; /*!< Holds the VLAN tag identifier for receive frames */
bogdanm 86:04dd9b1680ae 523
bogdanm 86:04dd9b1680ae 524 } ETH_MACInitTypeDef;
bogdanm 86:04dd9b1680ae 525
bogdanm 86:04dd9b1680ae 526
bogdanm 86:04dd9b1680ae 527 /**
bogdanm 86:04dd9b1680ae 528 * @brief ETH DMA Configuration Structure definition
bogdanm 86:04dd9b1680ae 529 */
bogdanm 86:04dd9b1680ae 530
bogdanm 86:04dd9b1680ae 531 typedef struct
bogdanm 86:04dd9b1680ae 532 {
bogdanm 86:04dd9b1680ae 533 uint32_t DropTCPIPChecksumErrorFrame; /*!< Selects or not the Dropping of TCP/IP Checksum Error Frames.
bogdanm 86:04dd9b1680ae 534 This parameter can be a value of @ref ETH_Drop_TCP_IP_Checksum_Error_Frame */
bogdanm 86:04dd9b1680ae 535
bogdanm 86:04dd9b1680ae 536 uint32_t ReceiveStoreForward; /*!< Enables or disables the Receive store and forward mode.
bogdanm 86:04dd9b1680ae 537 This parameter can be a value of @ref ETH_Receive_Store_Forward */
bogdanm 86:04dd9b1680ae 538
bogdanm 86:04dd9b1680ae 539 uint32_t FlushReceivedFrame; /*!< Enables or disables the flushing of received frames.
bogdanm 86:04dd9b1680ae 540 This parameter can be a value of @ref ETH_Flush_Received_Frame */
bogdanm 86:04dd9b1680ae 541
bogdanm 86:04dd9b1680ae 542 uint32_t TransmitStoreForward; /*!< Enables or disables Transmit store and forward mode.
bogdanm 86:04dd9b1680ae 543 This parameter can be a value of @ref ETH_Transmit_Store_Forward */
bogdanm 86:04dd9b1680ae 544
bogdanm 86:04dd9b1680ae 545 uint32_t TransmitThresholdControl; /*!< Selects or not the Transmit Threshold Control.
bogdanm 86:04dd9b1680ae 546 This parameter can be a value of @ref ETH_Transmit_Threshold_Control */
bogdanm 86:04dd9b1680ae 547
bogdanm 86:04dd9b1680ae 548 uint32_t ForwardErrorFrames; /*!< Selects or not the forward to the DMA of erroneous frames.
bogdanm 86:04dd9b1680ae 549 This parameter can be a value of @ref ETH_Forward_Error_Frames */
bogdanm 86:04dd9b1680ae 550
bogdanm 86:04dd9b1680ae 551 uint32_t ForwardUndersizedGoodFrames; /*!< Enables or disables the Rx FIFO to forward Undersized frames (frames with no Error
bogdanm 86:04dd9b1680ae 552 and length less than 64 bytes) including pad-bytes and CRC)
bogdanm 86:04dd9b1680ae 553 This parameter can be a value of @ref ETH_Forward_Undersized_Good_Frames */
bogdanm 86:04dd9b1680ae 554
bogdanm 86:04dd9b1680ae 555 uint32_t ReceiveThresholdControl; /*!< Selects the threshold level of the Receive FIFO.
bogdanm 86:04dd9b1680ae 556 This parameter can be a value of @ref ETH_Receive_Threshold_Control */
bogdanm 86:04dd9b1680ae 557
bogdanm 86:04dd9b1680ae 558 uint32_t SecondFrameOperate; /*!< Selects or not the Operate on second frame mode, which allows the DMA to process a second
bogdanm 86:04dd9b1680ae 559 frame of Transmit data even before obtaining the status for the first frame.
bogdanm 86:04dd9b1680ae 560 This parameter can be a value of @ref ETH_Second_Frame_Operate */
bogdanm 86:04dd9b1680ae 561
bogdanm 86:04dd9b1680ae 562 uint32_t AddressAlignedBeats; /*!< Enables or disables the Address Aligned Beats.
bogdanm 86:04dd9b1680ae 563 This parameter can be a value of @ref ETH_Address_Aligned_Beats */
bogdanm 86:04dd9b1680ae 564
bogdanm 86:04dd9b1680ae 565 uint32_t FixedBurst; /*!< Enables or disables the AHB Master interface fixed burst transfers.
bogdanm 86:04dd9b1680ae 566 This parameter can be a value of @ref ETH_Fixed_Burst */
bogdanm 86:04dd9b1680ae 567
bogdanm 86:04dd9b1680ae 568 uint32_t RxDMABurstLength; /*!< Indicates the maximum number of beats to be transferred in one Rx DMA transaction.
bogdanm 86:04dd9b1680ae 569 This parameter can be a value of @ref ETH_Rx_DMA_Burst_Length */
bogdanm 86:04dd9b1680ae 570
bogdanm 86:04dd9b1680ae 571 uint32_t TxDMABurstLength; /*!< Indicates the maximum number of beats to be transferred in one Tx DMA transaction.
bogdanm 86:04dd9b1680ae 572 This parameter can be a value of @ref ETH_Tx_DMA_Burst_Length */
bogdanm 86:04dd9b1680ae 573
bogdanm 86:04dd9b1680ae 574 uint32_t EnhancedDescriptorFormat; /*!< Enables the enhanced descriptor format.
bogdanm 86:04dd9b1680ae 575 This parameter can be a value of @ref ETH_DMA_Enhanced_descriptor_format */
bogdanm 86:04dd9b1680ae 576
bogdanm 86:04dd9b1680ae 577 uint32_t DescriptorSkipLength; /*!< Specifies the number of word to skip between two unchained descriptors (Ring mode)
bogdanm 86:04dd9b1680ae 578 This parameter must be a number between Min_Data = 0 and Max_Data = 32 */
bogdanm 86:04dd9b1680ae 579
bogdanm 86:04dd9b1680ae 580 uint32_t DMAArbitration; /*!< Selects the DMA Tx/Rx arbitration.
bogdanm 86:04dd9b1680ae 581 This parameter can be a value of @ref ETH_DMA_Arbitration */
bogdanm 86:04dd9b1680ae 582 } ETH_DMAInitTypeDef;
bogdanm 86:04dd9b1680ae 583
bogdanm 86:04dd9b1680ae 584
bogdanm 86:04dd9b1680ae 585 /**
bogdanm 86:04dd9b1680ae 586 * @brief ETH DMA Descriptors data structure definition
bogdanm 86:04dd9b1680ae 587 */
bogdanm 86:04dd9b1680ae 588
bogdanm 86:04dd9b1680ae 589 typedef struct
bogdanm 86:04dd9b1680ae 590 {
bogdanm 86:04dd9b1680ae 591 __IO uint32_t Status; /*!< Status */
bogdanm 86:04dd9b1680ae 592
bogdanm 86:04dd9b1680ae 593 uint32_t ControlBufferSize; /*!< Control and Buffer1, Buffer2 lengths */
bogdanm 86:04dd9b1680ae 594
bogdanm 86:04dd9b1680ae 595 uint32_t Buffer1Addr; /*!< Buffer1 address pointer */
bogdanm 86:04dd9b1680ae 596
bogdanm 86:04dd9b1680ae 597 uint32_t Buffer2NextDescAddr; /*!< Buffer2 or next descriptor address pointer */
bogdanm 86:04dd9b1680ae 598
bogdanm 86:04dd9b1680ae 599 /*!< Enhanced ETHERNET DMA PTP Descriptors */
bogdanm 86:04dd9b1680ae 600 uint32_t ExtendedStatus; /*!< Extended status for PTP receive descriptor */
bogdanm 86:04dd9b1680ae 601
bogdanm 86:04dd9b1680ae 602 uint32_t Reserved1; /*!< Reserved */
bogdanm 86:04dd9b1680ae 603
bogdanm 86:04dd9b1680ae 604 uint32_t TimeStampLow; /*!< Time Stamp Low value for transmit and receive */
bogdanm 86:04dd9b1680ae 605
bogdanm 86:04dd9b1680ae 606 uint32_t TimeStampHigh; /*!< Time Stamp High value for transmit and receive */
bogdanm 86:04dd9b1680ae 607
bogdanm 86:04dd9b1680ae 608 } ETH_DMADescTypeDef;
bogdanm 86:04dd9b1680ae 609
bogdanm 86:04dd9b1680ae 610
bogdanm 86:04dd9b1680ae 611 /**
bogdanm 86:04dd9b1680ae 612 * @brief Received Frame Informations structure definition
bogdanm 86:04dd9b1680ae 613 */
bogdanm 86:04dd9b1680ae 614 typedef struct
bogdanm 86:04dd9b1680ae 615 {
bogdanm 86:04dd9b1680ae 616 ETH_DMADescTypeDef *FSRxDesc; /*!< First Segment Rx Desc */
bogdanm 86:04dd9b1680ae 617
bogdanm 86:04dd9b1680ae 618 ETH_DMADescTypeDef *LSRxDesc; /*!< Last Segment Rx Desc */
bogdanm 86:04dd9b1680ae 619
bogdanm 86:04dd9b1680ae 620 uint32_t SegCount; /*!< Segment count */
bogdanm 86:04dd9b1680ae 621
bogdanm 86:04dd9b1680ae 622 uint32_t length; /*!< Frame length */
bogdanm 86:04dd9b1680ae 623
bogdanm 86:04dd9b1680ae 624 uint32_t buffer; /*!< Frame buffer */
bogdanm 86:04dd9b1680ae 625
bogdanm 86:04dd9b1680ae 626 } ETH_DMARxFrameInfos;
bogdanm 86:04dd9b1680ae 627
bogdanm 86:04dd9b1680ae 628
bogdanm 86:04dd9b1680ae 629 /**
bogdanm 86:04dd9b1680ae 630 * @brief ETH Handle Structure definition
bogdanm 86:04dd9b1680ae 631 */
bogdanm 86:04dd9b1680ae 632
bogdanm 86:04dd9b1680ae 633 typedef struct
bogdanm 86:04dd9b1680ae 634 {
bogdanm 86:04dd9b1680ae 635 ETH_TypeDef *Instance; /*!< Register base address */
bogdanm 86:04dd9b1680ae 636
bogdanm 86:04dd9b1680ae 637 ETH_InitTypeDef Init; /*!< Ethernet Init Configuration */
bogdanm 86:04dd9b1680ae 638
bogdanm 86:04dd9b1680ae 639 uint32_t LinkStatus; /*!< Ethernet link status */
bogdanm 86:04dd9b1680ae 640
bogdanm 86:04dd9b1680ae 641 ETH_DMADescTypeDef *RxDesc; /*!< Rx descriptor to Get */
bogdanm 86:04dd9b1680ae 642
bogdanm 86:04dd9b1680ae 643 ETH_DMADescTypeDef *TxDesc; /*!< Tx descriptor to Set */
bogdanm 86:04dd9b1680ae 644
bogdanm 86:04dd9b1680ae 645 ETH_DMARxFrameInfos RxFrameInfos; /*!< last Rx frame infos */
bogdanm 86:04dd9b1680ae 646
bogdanm 86:04dd9b1680ae 647 __IO HAL_ETH_StateTypeDef State; /*!< ETH communication state */
bogdanm 86:04dd9b1680ae 648
bogdanm 86:04dd9b1680ae 649 HAL_LockTypeDef Lock; /*!< ETH Lock */
bogdanm 86:04dd9b1680ae 650
bogdanm 86:04dd9b1680ae 651 } ETH_HandleTypeDef;
bogdanm 86:04dd9b1680ae 652
Kojto 99:dbbf35b96557 653 /**
Kojto 99:dbbf35b96557 654 * @}
Kojto 99:dbbf35b96557 655 */
bogdanm 86:04dd9b1680ae 656
Kojto 99:dbbf35b96557 657 /* Exported constants --------------------------------------------------------*/
Kojto 99:dbbf35b96557 658 /** @defgroup ETH_Exported_Constants ETH Exported Constants
Kojto 99:dbbf35b96557 659 * @{
Kojto 99:dbbf35b96557 660 */
bogdanm 86:04dd9b1680ae 661
Kojto 99:dbbf35b96557 662 /** @defgroup ETH_Buffers_setting ETH Buffers setting
bogdanm 86:04dd9b1680ae 663 * @{
bogdanm 86:04dd9b1680ae 664 */
Kojto 99:dbbf35b96557 665 #define ETH_MAX_PACKET_SIZE ((uint32_t)1524) /*!< ETH_HEADER + ETH_EXTRA + ETH_VLAN_TAG + ETH_MAX_ETH_PAYLOAD + ETH_CRC */
bogdanm 86:04dd9b1680ae 666 #define ETH_HEADER ((uint32_t)14) /*!< 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */
bogdanm 86:04dd9b1680ae 667 #define ETH_CRC ((uint32_t)4) /*!< Ethernet CRC */
bogdanm 86:04dd9b1680ae 668 #define ETH_EXTRA ((uint32_t)2) /*!< Extra bytes in some cases */
Kojto 99:dbbf35b96557 669 #define ETH_VLAN_TAG ((uint32_t)4) /*!< optional 802.1q VLAN Tag */
Kojto 99:dbbf35b96557 670 #define ETH_MIN_ETH_PAYLOAD ((uint32_t)46) /*!< Minimum Ethernet payload size */
Kojto 99:dbbf35b96557 671 #define ETH_MAX_ETH_PAYLOAD ((uint32_t)1500) /*!< Maximum Ethernet payload size */
Kojto 99:dbbf35b96557 672 #define ETH_JUMBO_FRAME_PAYLOAD ((uint32_t)9000) /*!< Jumbo frame payload size */
bogdanm 86:04dd9b1680ae 673
bogdanm 86:04dd9b1680ae 674 /* Ethernet driver receive buffers are organized in a chained linked-list, when
bogdanm 86:04dd9b1680ae 675 an ethernet packet is received, the Rx-DMA will transfer the packet from RxFIFO
bogdanm 86:04dd9b1680ae 676 to the driver receive buffers memory.
bogdanm 86:04dd9b1680ae 677
bogdanm 86:04dd9b1680ae 678 Depending on the size of the received ethernet packet and the size of
bogdanm 86:04dd9b1680ae 679 each ethernet driver receive buffer, the received packet can take one or more
bogdanm 86:04dd9b1680ae 680 ethernet driver receive buffer.
bogdanm 86:04dd9b1680ae 681
bogdanm 86:04dd9b1680ae 682 In below are defined the size of one ethernet driver receive buffer ETH_RX_BUF_SIZE
bogdanm 86:04dd9b1680ae 683 and the total count of the driver receive buffers ETH_RXBUFNB.
bogdanm 86:04dd9b1680ae 684
bogdanm 86:04dd9b1680ae 685 The configured value for ETH_RX_BUF_SIZE and ETH_RXBUFNB are only provided as
bogdanm 86:04dd9b1680ae 686 example, they can be reconfigured in the application layer to fit the application
bogdanm 86:04dd9b1680ae 687 needs */
bogdanm 86:04dd9b1680ae 688
bogdanm 86:04dd9b1680ae 689 /* Here we configure each Ethernet driver receive buffer to fit the Max size Ethernet
bogdanm 86:04dd9b1680ae 690 packet */
bogdanm 86:04dd9b1680ae 691 #ifndef ETH_RX_BUF_SIZE
bogdanm 86:04dd9b1680ae 692 #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE
bogdanm 86:04dd9b1680ae 693 #endif
bogdanm 86:04dd9b1680ae 694
bogdanm 86:04dd9b1680ae 695 /* 5 Ethernet driver receive buffers are used (in a chained linked list)*/
bogdanm 86:04dd9b1680ae 696 #ifndef ETH_RXBUFNB
bogdanm 86:04dd9b1680ae 697 #define ETH_RXBUFNB ((uint32_t)5 /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
bogdanm 86:04dd9b1680ae 698 #endif
bogdanm 86:04dd9b1680ae 699
bogdanm 86:04dd9b1680ae 700
bogdanm 86:04dd9b1680ae 701 /* Ethernet driver transmit buffers are organized in a chained linked-list, when
bogdanm 86:04dd9b1680ae 702 an ethernet packet is transmitted, Tx-DMA will transfer the packet from the
bogdanm 86:04dd9b1680ae 703 driver transmit buffers memory to the TxFIFO.
bogdanm 86:04dd9b1680ae 704
bogdanm 86:04dd9b1680ae 705 Depending on the size of the Ethernet packet to be transmitted and the size of
bogdanm 86:04dd9b1680ae 706 each ethernet driver transmit buffer, the packet to be transmitted can take
bogdanm 86:04dd9b1680ae 707 one or more ethernet driver transmit buffer.
bogdanm 86:04dd9b1680ae 708
bogdanm 86:04dd9b1680ae 709 In below are defined the size of one ethernet driver transmit buffer ETH_TX_BUF_SIZE
bogdanm 86:04dd9b1680ae 710 and the total count of the driver transmit buffers ETH_TXBUFNB.
bogdanm 86:04dd9b1680ae 711
bogdanm 86:04dd9b1680ae 712 The configured value for ETH_TX_BUF_SIZE and ETH_TXBUFNB are only provided as
bogdanm 86:04dd9b1680ae 713 example, they can be reconfigured in the application layer to fit the application
bogdanm 86:04dd9b1680ae 714 needs */
bogdanm 86:04dd9b1680ae 715
bogdanm 86:04dd9b1680ae 716 /* Here we configure each Ethernet driver transmit buffer to fit the Max size Ethernet
bogdanm 86:04dd9b1680ae 717 packet */
bogdanm 86:04dd9b1680ae 718 #ifndef ETH_TX_BUF_SIZE
bogdanm 86:04dd9b1680ae 719 #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE
bogdanm 86:04dd9b1680ae 720 #endif
bogdanm 86:04dd9b1680ae 721
bogdanm 86:04dd9b1680ae 722 /* 5 ethernet driver transmit buffers are used (in a chained linked list)*/
bogdanm 86:04dd9b1680ae 723 #ifndef ETH_TXBUFNB
bogdanm 86:04dd9b1680ae 724 #define ETH_TXBUFNB ((uint32_t)5 /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
bogdanm 86:04dd9b1680ae 725 #endif
bogdanm 86:04dd9b1680ae 726
Kojto 99:dbbf35b96557 727 /**
Kojto 99:dbbf35b96557 728 * @}
Kojto 99:dbbf35b96557 729 */
Kojto 99:dbbf35b96557 730
Kojto 99:dbbf35b96557 731 /** @defgroup ETH_DMA_TX_Descriptor ETH DMA TX Descriptor
Kojto 99:dbbf35b96557 732 * @{
Kojto 99:dbbf35b96557 733 */
bogdanm 86:04dd9b1680ae 734
bogdanm 86:04dd9b1680ae 735 /*
Kojto 99:dbbf35b96557 736 DMA Tx Descriptor
bogdanm 86:04dd9b1680ae 737 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 738 TDES0 | OWN(31) | CTRL[30:26] | Reserved[25:24] | CTRL[23:20] | Reserved[19:17] | Status[16:0] |
bogdanm 86:04dd9b1680ae 739 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 740 TDES1 | Reserved[31:29] | Buffer2 ByteCount[28:16] | Reserved[15:13] | Buffer1 ByteCount[12:0] |
bogdanm 86:04dd9b1680ae 741 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 742 TDES2 | Buffer1 Address [31:0] |
bogdanm 86:04dd9b1680ae 743 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 744 TDES3 | Buffer2 Address [31:0] / Next Descriptor Address [31:0] |
bogdanm 86:04dd9b1680ae 745 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 746 */
bogdanm 86:04dd9b1680ae 747
bogdanm 86:04dd9b1680ae 748 /**
bogdanm 86:04dd9b1680ae 749 * @brief Bit definition of TDES0 register: DMA Tx descriptor status register
bogdanm 86:04dd9b1680ae 750 */
bogdanm 86:04dd9b1680ae 751 #define ETH_DMATXDESC_OWN ((uint32_t)0x80000000) /*!< OWN bit: descriptor is owned by DMA engine */
bogdanm 86:04dd9b1680ae 752 #define ETH_DMATXDESC_IC ((uint32_t)0x40000000) /*!< Interrupt on Completion */
bogdanm 86:04dd9b1680ae 753 #define ETH_DMATXDESC_LS ((uint32_t)0x20000000) /*!< Last Segment */
bogdanm 86:04dd9b1680ae 754 #define ETH_DMATXDESC_FS ((uint32_t)0x10000000) /*!< First Segment */
bogdanm 86:04dd9b1680ae 755 #define ETH_DMATXDESC_DC ((uint32_t)0x08000000) /*!< Disable CRC */
bogdanm 86:04dd9b1680ae 756 #define ETH_DMATXDESC_DP ((uint32_t)0x04000000) /*!< Disable Padding */
bogdanm 86:04dd9b1680ae 757 #define ETH_DMATXDESC_TTSE ((uint32_t)0x02000000) /*!< Transmit Time Stamp Enable */
bogdanm 86:04dd9b1680ae 758 #define ETH_DMATXDESC_CIC ((uint32_t)0x00C00000) /*!< Checksum Insertion Control: 4 cases */
bogdanm 86:04dd9b1680ae 759 #define ETH_DMATXDESC_CIC_BYPASS ((uint32_t)0x00000000) /*!< Do Nothing: Checksum Engine is bypassed */
bogdanm 86:04dd9b1680ae 760 #define ETH_DMATXDESC_CIC_IPV4HEADER ((uint32_t)0x00400000) /*!< IPV4 header Checksum Insertion */
bogdanm 86:04dd9b1680ae 761 #define ETH_DMATXDESC_CIC_TCPUDPICMP_SEGMENT ((uint32_t)0x00800000) /*!< TCP/UDP/ICMP Checksum Insertion calculated over segment only */
bogdanm 86:04dd9b1680ae 762 #define ETH_DMATXDESC_CIC_TCPUDPICMP_FULL ((uint32_t)0x00C00000) /*!< TCP/UDP/ICMP Checksum Insertion fully calculated */
bogdanm 86:04dd9b1680ae 763 #define ETH_DMATXDESC_TER ((uint32_t)0x00200000) /*!< Transmit End of Ring */
bogdanm 86:04dd9b1680ae 764 #define ETH_DMATXDESC_TCH ((uint32_t)0x00100000) /*!< Second Address Chained */
bogdanm 86:04dd9b1680ae 765 #define ETH_DMATXDESC_TTSS ((uint32_t)0x00020000) /*!< Tx Time Stamp Status */
bogdanm 86:04dd9b1680ae 766 #define ETH_DMATXDESC_IHE ((uint32_t)0x00010000) /*!< IP Header Error */
bogdanm 86:04dd9b1680ae 767 #define ETH_DMATXDESC_ES ((uint32_t)0x00008000) /*!< Error summary: OR of the following bits: UE || ED || EC || LCO || NC || LCA || FF || JT */
bogdanm 86:04dd9b1680ae 768 #define ETH_DMATXDESC_JT ((uint32_t)0x00004000) /*!< Jabber Timeout */
bogdanm 86:04dd9b1680ae 769 #define ETH_DMATXDESC_FF ((uint32_t)0x00002000) /*!< Frame Flushed: DMA/MTL flushed the frame due to SW flush */
bogdanm 86:04dd9b1680ae 770 #define ETH_DMATXDESC_PCE ((uint32_t)0x00001000) /*!< Payload Checksum Error */
bogdanm 86:04dd9b1680ae 771 #define ETH_DMATXDESC_LCA ((uint32_t)0x00000800) /*!< Loss of Carrier: carrier lost during transmission */
bogdanm 86:04dd9b1680ae 772 #define ETH_DMATXDESC_NC ((uint32_t)0x00000400) /*!< No Carrier: no carrier signal from the transceiver */
bogdanm 86:04dd9b1680ae 773 #define ETH_DMATXDESC_LCO ((uint32_t)0x00000200) /*!< Late Collision: transmission aborted due to collision */
bogdanm 86:04dd9b1680ae 774 #define ETH_DMATXDESC_EC ((uint32_t)0x00000100) /*!< Excessive Collision: transmission aborted after 16 collisions */
bogdanm 86:04dd9b1680ae 775 #define ETH_DMATXDESC_VF ((uint32_t)0x00000080) /*!< VLAN Frame */
bogdanm 86:04dd9b1680ae 776 #define ETH_DMATXDESC_CC ((uint32_t)0x00000078) /*!< Collision Count */
bogdanm 86:04dd9b1680ae 777 #define ETH_DMATXDESC_ED ((uint32_t)0x00000004) /*!< Excessive Deferral */
bogdanm 86:04dd9b1680ae 778 #define ETH_DMATXDESC_UF ((uint32_t)0x00000002) /*!< Underflow Error: late data arrival from the memory */
bogdanm 86:04dd9b1680ae 779 #define ETH_DMATXDESC_DB ((uint32_t)0x00000001) /*!< Deferred Bit */
bogdanm 86:04dd9b1680ae 780
bogdanm 86:04dd9b1680ae 781 /**
bogdanm 86:04dd9b1680ae 782 * @brief Bit definition of TDES1 register
bogdanm 86:04dd9b1680ae 783 */
bogdanm 86:04dd9b1680ae 784 #define ETH_DMATXDESC_TBS2 ((uint32_t)0x1FFF0000) /*!< Transmit Buffer2 Size */
bogdanm 86:04dd9b1680ae 785 #define ETH_DMATXDESC_TBS1 ((uint32_t)0x00001FFF) /*!< Transmit Buffer1 Size */
bogdanm 86:04dd9b1680ae 786
bogdanm 86:04dd9b1680ae 787 /**
bogdanm 86:04dd9b1680ae 788 * @brief Bit definition of TDES2 register
bogdanm 86:04dd9b1680ae 789 */
bogdanm 86:04dd9b1680ae 790 #define ETH_DMATXDESC_B1AP ((uint32_t)0xFFFFFFFF) /*!< Buffer1 Address Pointer */
bogdanm 86:04dd9b1680ae 791
bogdanm 86:04dd9b1680ae 792 /**
bogdanm 86:04dd9b1680ae 793 * @brief Bit definition of TDES3 register
bogdanm 86:04dd9b1680ae 794 */
bogdanm 86:04dd9b1680ae 795 #define ETH_DMATXDESC_B2AP ((uint32_t)0xFFFFFFFF) /*!< Buffer2 Address Pointer */
bogdanm 86:04dd9b1680ae 796
bogdanm 86:04dd9b1680ae 797 /*---------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 798 TDES6 | Transmit Time Stamp Low [31:0] |
bogdanm 86:04dd9b1680ae 799 -----------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 800 TDES7 | Transmit Time Stamp High [31:0] |
bogdanm 86:04dd9b1680ae 801 ----------------------------------------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 802
bogdanm 86:04dd9b1680ae 803 /* Bit definition of TDES6 register */
bogdanm 86:04dd9b1680ae 804 #define ETH_DMAPTPTXDESC_TTSL ((uint32_t)0xFFFFFFFF) /* Transmit Time Stamp Low */
bogdanm 86:04dd9b1680ae 805
bogdanm 86:04dd9b1680ae 806 /* Bit definition of TDES7 register */
bogdanm 86:04dd9b1680ae 807 #define ETH_DMAPTPTXDESC_TTSH ((uint32_t)0xFFFFFFFF) /* Transmit Time Stamp High */
bogdanm 86:04dd9b1680ae 808
bogdanm 86:04dd9b1680ae 809 /**
bogdanm 86:04dd9b1680ae 810 * @}
bogdanm 86:04dd9b1680ae 811 */
Kojto 99:dbbf35b96557 812 /** @defgroup ETH_DMA_RX_Descriptor ETH DMA RX Descriptor
bogdanm 86:04dd9b1680ae 813 * @{
bogdanm 86:04dd9b1680ae 814 */
bogdanm 86:04dd9b1680ae 815
bogdanm 86:04dd9b1680ae 816 /*
bogdanm 86:04dd9b1680ae 817 DMA Rx Descriptor
bogdanm 86:04dd9b1680ae 818 --------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 819 RDES0 | OWN(31) | Status [30:0] |
bogdanm 86:04dd9b1680ae 820 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 821 RDES1 | CTRL(31) | Reserved[30:29] | Buffer2 ByteCount[28:16] | CTRL[15:14] | Reserved(13) | Buffer1 ByteCount[12:0] |
bogdanm 86:04dd9b1680ae 822 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 823 RDES2 | Buffer1 Address [31:0] |
bogdanm 86:04dd9b1680ae 824 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 825 RDES3 | Buffer2 Address [31:0] / Next Descriptor Address [31:0] |
bogdanm 86:04dd9b1680ae 826 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 827 */
bogdanm 86:04dd9b1680ae 828
bogdanm 86:04dd9b1680ae 829 /**
bogdanm 86:04dd9b1680ae 830 * @brief Bit definition of RDES0 register: DMA Rx descriptor status register
bogdanm 86:04dd9b1680ae 831 */
bogdanm 86:04dd9b1680ae 832 #define ETH_DMARXDESC_OWN ((uint32_t)0x80000000) /*!< OWN bit: descriptor is owned by DMA engine */
bogdanm 86:04dd9b1680ae 833 #define ETH_DMARXDESC_AFM ((uint32_t)0x40000000) /*!< DA Filter Fail for the rx frame */
bogdanm 86:04dd9b1680ae 834 #define ETH_DMARXDESC_FL ((uint32_t)0x3FFF0000) /*!< Receive descriptor frame length */
bogdanm 86:04dd9b1680ae 835 #define ETH_DMARXDESC_ES ((uint32_t)0x00008000) /*!< Error summary: OR of the following bits: DE || OE || IPC || LC || RWT || RE || CE */
bogdanm 86:04dd9b1680ae 836 #define ETH_DMARXDESC_DE ((uint32_t)0x00004000) /*!< Descriptor error: no more descriptors for receive frame */
bogdanm 86:04dd9b1680ae 837 #define ETH_DMARXDESC_SAF ((uint32_t)0x00002000) /*!< SA Filter Fail for the received frame */
bogdanm 86:04dd9b1680ae 838 #define ETH_DMARXDESC_LE ((uint32_t)0x00001000) /*!< Frame size not matching with length field */
bogdanm 86:04dd9b1680ae 839 #define ETH_DMARXDESC_OE ((uint32_t)0x00000800) /*!< Overflow Error: Frame was damaged due to buffer overflow */
bogdanm 86:04dd9b1680ae 840 #define ETH_DMARXDESC_VLAN ((uint32_t)0x00000400) /*!< VLAN Tag: received frame is a VLAN frame */
bogdanm 86:04dd9b1680ae 841 #define ETH_DMARXDESC_FS ((uint32_t)0x00000200) /*!< First descriptor of the frame */
bogdanm 86:04dd9b1680ae 842 #define ETH_DMARXDESC_LS ((uint32_t)0x00000100) /*!< Last descriptor of the frame */
bogdanm 86:04dd9b1680ae 843 #define ETH_DMARXDESC_IPV4HCE ((uint32_t)0x00000080) /*!< IPC Checksum Error: Rx Ipv4 header checksum error */
bogdanm 86:04dd9b1680ae 844 #define ETH_DMARXDESC_LC ((uint32_t)0x00000040) /*!< Late collision occurred during reception */
bogdanm 86:04dd9b1680ae 845 #define ETH_DMARXDESC_FT ((uint32_t)0x00000020) /*!< Frame type - Ethernet, otherwise 802.3 */
bogdanm 86:04dd9b1680ae 846 #define ETH_DMARXDESC_RWT ((uint32_t)0x00000010) /*!< Receive Watchdog Timeout: watchdog timer expired during reception */
bogdanm 86:04dd9b1680ae 847 #define ETH_DMARXDESC_RE ((uint32_t)0x00000008) /*!< Receive error: error reported by MII interface */
bogdanm 86:04dd9b1680ae 848 #define ETH_DMARXDESC_DBE ((uint32_t)0x00000004) /*!< Dribble bit error: frame contains non int multiple of 8 bits */
bogdanm 86:04dd9b1680ae 849 #define ETH_DMARXDESC_CE ((uint32_t)0x00000002) /*!< CRC error */
bogdanm 86:04dd9b1680ae 850 #define ETH_DMARXDESC_MAMPCE ((uint32_t)0x00000001) /*!< Rx MAC Address/Payload Checksum Error: Rx MAC address matched/ Rx Payload Checksum Error */
bogdanm 86:04dd9b1680ae 851
bogdanm 86:04dd9b1680ae 852 /**
bogdanm 86:04dd9b1680ae 853 * @brief Bit definition of RDES1 register
bogdanm 86:04dd9b1680ae 854 */
bogdanm 86:04dd9b1680ae 855 #define ETH_DMARXDESC_DIC ((uint32_t)0x80000000) /*!< Disable Interrupt on Completion */
bogdanm 86:04dd9b1680ae 856 #define ETH_DMARXDESC_RBS2 ((uint32_t)0x1FFF0000) /*!< Receive Buffer2 Size */
bogdanm 86:04dd9b1680ae 857 #define ETH_DMARXDESC_RER ((uint32_t)0x00008000) /*!< Receive End of Ring */
bogdanm 86:04dd9b1680ae 858 #define ETH_DMARXDESC_RCH ((uint32_t)0x00004000) /*!< Second Address Chained */
bogdanm 86:04dd9b1680ae 859 #define ETH_DMARXDESC_RBS1 ((uint32_t)0x00001FFF) /*!< Receive Buffer1 Size */
bogdanm 86:04dd9b1680ae 860
bogdanm 86:04dd9b1680ae 861 /**
bogdanm 86:04dd9b1680ae 862 * @brief Bit definition of RDES2 register
bogdanm 86:04dd9b1680ae 863 */
bogdanm 86:04dd9b1680ae 864 #define ETH_DMARXDESC_B1AP ((uint32_t)0xFFFFFFFF) /*!< Buffer1 Address Pointer */
bogdanm 86:04dd9b1680ae 865
bogdanm 86:04dd9b1680ae 866 /**
bogdanm 86:04dd9b1680ae 867 * @brief Bit definition of RDES3 register
bogdanm 86:04dd9b1680ae 868 */
bogdanm 86:04dd9b1680ae 869 #define ETH_DMARXDESC_B2AP ((uint32_t)0xFFFFFFFF) /*!< Buffer2 Address Pointer */
bogdanm 86:04dd9b1680ae 870
bogdanm 86:04dd9b1680ae 871 /*---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 872 RDES4 | Reserved[31:15] | Extended Status [14:0] |
bogdanm 86:04dd9b1680ae 873 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 874 RDES5 | Reserved[31:0] |
bogdanm 86:04dd9b1680ae 875 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 876 RDES6 | Receive Time Stamp Low [31:0] |
bogdanm 86:04dd9b1680ae 877 ---------------------------------------------------------------------------------------------------------------------
bogdanm 86:04dd9b1680ae 878 RDES7 | Receive Time Stamp High [31:0] |
bogdanm 86:04dd9b1680ae 879 --------------------------------------------------------------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 880
bogdanm 86:04dd9b1680ae 881 /* Bit definition of RDES4 register */
bogdanm 86:04dd9b1680ae 882 #define ETH_DMAPTPRXDESC_PTPV ((uint32_t)0x00002000) /* PTP Version */
bogdanm 86:04dd9b1680ae 883 #define ETH_DMAPTPRXDESC_PTPFT ((uint32_t)0x00001000) /* PTP Frame Type */
bogdanm 86:04dd9b1680ae 884 #define ETH_DMAPTPRXDESC_PTPMT ((uint32_t)0x00000F00) /* PTP Message Type */
bogdanm 86:04dd9b1680ae 885 #define ETH_DMAPTPRXDESC_PTPMT_SYNC ((uint32_t)0x00000100) /* SYNC message (all clock types) */
bogdanm 86:04dd9b1680ae 886 #define ETH_DMAPTPRXDESC_PTPMT_FOLLOWUP ((uint32_t)0x00000200) /* FollowUp message (all clock types) */
bogdanm 86:04dd9b1680ae 887 #define ETH_DMAPTPRXDESC_PTPMT_DELAYREQ ((uint32_t)0x00000300) /* DelayReq message (all clock types) */
bogdanm 86:04dd9b1680ae 888 #define ETH_DMAPTPRXDESC_PTPMT_DELAYRESP ((uint32_t)0x00000400) /* DelayResp message (all clock types) */
bogdanm 86:04dd9b1680ae 889 #define ETH_DMAPTPRXDESC_PTPMT_PDELAYREQ_ANNOUNCE ((uint32_t)0x00000500) /* PdelayReq message (peer-to-peer transparent clock) or Announce message (Ordinary or Boundary clock) */
bogdanm 86:04dd9b1680ae 890 #define ETH_DMAPTPRXDESC_PTPMT_PDELAYRESP_MANAG ((uint32_t)0x00000600) /* PdelayResp message (peer-to-peer transparent clock) or Management message (Ordinary or Boundary clock) */
bogdanm 86:04dd9b1680ae 891 #define ETH_DMAPTPRXDESC_PTPMT_PDELAYRESPFOLLOWUP_SIGNAL ((uint32_t)0x00000700) /* PdelayRespFollowUp message (peer-to-peer transparent clock) or Signaling message (Ordinary or Boundary clock) */
bogdanm 86:04dd9b1680ae 892 #define ETH_DMAPTPRXDESC_IPV6PR ((uint32_t)0x00000080) /* IPv6 Packet Received */
bogdanm 86:04dd9b1680ae 893 #define ETH_DMAPTPRXDESC_IPV4PR ((uint32_t)0x00000040) /* IPv4 Packet Received */
bogdanm 86:04dd9b1680ae 894 #define ETH_DMAPTPRXDESC_IPCB ((uint32_t)0x00000020) /* IP Checksum Bypassed */
bogdanm 86:04dd9b1680ae 895 #define ETH_DMAPTPRXDESC_IPPE ((uint32_t)0x00000010) /* IP Payload Error */
bogdanm 86:04dd9b1680ae 896 #define ETH_DMAPTPRXDESC_IPHE ((uint32_t)0x00000008) /* IP Header Error */
bogdanm 86:04dd9b1680ae 897 #define ETH_DMAPTPRXDESC_IPPT ((uint32_t)0x00000007) /* IP Payload Type */
bogdanm 86:04dd9b1680ae 898 #define ETH_DMAPTPRXDESC_IPPT_UDP ((uint32_t)0x00000001) /* UDP payload encapsulated in the IP datagram */
bogdanm 86:04dd9b1680ae 899 #define ETH_DMAPTPRXDESC_IPPT_TCP ((uint32_t)0x00000002) /* TCP payload encapsulated in the IP datagram */
bogdanm 86:04dd9b1680ae 900 #define ETH_DMAPTPRXDESC_IPPT_ICMP ((uint32_t)0x00000003) /* ICMP payload encapsulated in the IP datagram */
bogdanm 86:04dd9b1680ae 901
bogdanm 86:04dd9b1680ae 902 /* Bit definition of RDES6 register */
bogdanm 86:04dd9b1680ae 903 #define ETH_DMAPTPRXDESC_RTSL ((uint32_t)0xFFFFFFFF) /* Receive Time Stamp Low */
bogdanm 86:04dd9b1680ae 904
bogdanm 86:04dd9b1680ae 905 /* Bit definition of RDES7 register */
bogdanm 86:04dd9b1680ae 906 #define ETH_DMAPTPRXDESC_RTSH ((uint32_t)0xFFFFFFFF) /* Receive Time Stamp High */
Kojto 99:dbbf35b96557 907 /**
Kojto 99:dbbf35b96557 908 * @}
Kojto 99:dbbf35b96557 909 */
Kojto 99:dbbf35b96557 910 /** @defgroup ETH_AutoNegotiation ETH AutoNegotiation
bogdanm 86:04dd9b1680ae 911 * @{
bogdanm 86:04dd9b1680ae 912 */
bogdanm 86:04dd9b1680ae 913 #define ETH_AUTONEGOTIATION_ENABLE ((uint32_t)0x00000001)
bogdanm 86:04dd9b1680ae 914 #define ETH_AUTONEGOTIATION_DISABLE ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 915
bogdanm 86:04dd9b1680ae 916 /**
bogdanm 86:04dd9b1680ae 917 * @}
bogdanm 86:04dd9b1680ae 918 */
Kojto 99:dbbf35b96557 919 /** @defgroup ETH_Speed ETH Speed
bogdanm 86:04dd9b1680ae 920 * @{
bogdanm 86:04dd9b1680ae 921 */
bogdanm 86:04dd9b1680ae 922 #define ETH_SPEED_10M ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 923 #define ETH_SPEED_100M ((uint32_t)0x00004000)
Kojto 99:dbbf35b96557 924
bogdanm 86:04dd9b1680ae 925 /**
bogdanm 86:04dd9b1680ae 926 * @}
bogdanm 86:04dd9b1680ae 927 */
Kojto 99:dbbf35b96557 928 /** @defgroup ETH_Duplex_Mode ETH Duplex Mode
bogdanm 86:04dd9b1680ae 929 * @{
bogdanm 86:04dd9b1680ae 930 */
bogdanm 86:04dd9b1680ae 931 #define ETH_MODE_FULLDUPLEX ((uint32_t)0x00000800)
bogdanm 86:04dd9b1680ae 932 #define ETH_MODE_HALFDUPLEX ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 933 /**
bogdanm 86:04dd9b1680ae 934 * @}
bogdanm 86:04dd9b1680ae 935 */
Kojto 99:dbbf35b96557 936 /** @defgroup ETH_Rx_Mode ETH Rx Mode
bogdanm 86:04dd9b1680ae 937 * @{
bogdanm 86:04dd9b1680ae 938 */
bogdanm 86:04dd9b1680ae 939 #define ETH_RXPOLLING_MODE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 940 #define ETH_RXINTERRUPT_MODE ((uint32_t)0x00000001)
bogdanm 86:04dd9b1680ae 941 /**
bogdanm 86:04dd9b1680ae 942 * @}
bogdanm 86:04dd9b1680ae 943 */
bogdanm 86:04dd9b1680ae 944
Kojto 99:dbbf35b96557 945 /** @defgroup ETH_Checksum_Mode ETH Checksum Mode
bogdanm 86:04dd9b1680ae 946 * @{
bogdanm 86:04dd9b1680ae 947 */
bogdanm 86:04dd9b1680ae 948 #define ETH_CHECKSUM_BY_HARDWARE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 949 #define ETH_CHECKSUM_BY_SOFTWARE ((uint32_t)0x00000001)
bogdanm 86:04dd9b1680ae 950 /**
bogdanm 86:04dd9b1680ae 951 * @}
bogdanm 86:04dd9b1680ae 952 */
bogdanm 86:04dd9b1680ae 953
Kojto 99:dbbf35b96557 954 /** @defgroup ETH_Media_Interface ETH Media Interface
bogdanm 86:04dd9b1680ae 955 * @{
bogdanm 86:04dd9b1680ae 956 */
bogdanm 86:04dd9b1680ae 957 #define ETH_MEDIA_INTERFACE_MII ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 958 #define ETH_MEDIA_INTERFACE_RMII ((uint32_t)SYSCFG_PMC_MII_RMII_SEL)
bogdanm 86:04dd9b1680ae 959 /**
bogdanm 86:04dd9b1680ae 960 * @}
bogdanm 86:04dd9b1680ae 961 */
bogdanm 86:04dd9b1680ae 962
Kojto 99:dbbf35b96557 963 /** @defgroup ETH_Watchdog ETH Watchdog
bogdanm 86:04dd9b1680ae 964 * @{
bogdanm 86:04dd9b1680ae 965 */
bogdanm 86:04dd9b1680ae 966 #define ETH_WATCHDOG_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 967 #define ETH_WATCHDOG_DISABLE ((uint32_t)0x00800000)
bogdanm 86:04dd9b1680ae 968 /**
bogdanm 86:04dd9b1680ae 969 * @}
bogdanm 86:04dd9b1680ae 970 */
bogdanm 86:04dd9b1680ae 971
Kojto 99:dbbf35b96557 972 /** @defgroup ETH_Jabber ETH Jabber
bogdanm 86:04dd9b1680ae 973 * @{
bogdanm 86:04dd9b1680ae 974 */
bogdanm 86:04dd9b1680ae 975 #define ETH_JABBER_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 976 #define ETH_JABBER_DISABLE ((uint32_t)0x00400000)
bogdanm 86:04dd9b1680ae 977 /**
bogdanm 86:04dd9b1680ae 978 * @}
bogdanm 86:04dd9b1680ae 979 */
bogdanm 86:04dd9b1680ae 980
Kojto 99:dbbf35b96557 981 /** @defgroup ETH_Inter_Frame_Gap ETH Inter Frame Gap
bogdanm 86:04dd9b1680ae 982 * @{
bogdanm 86:04dd9b1680ae 983 */
bogdanm 86:04dd9b1680ae 984 #define ETH_INTERFRAMEGAP_96BIT ((uint32_t)0x00000000) /*!< minimum IFG between frames during transmission is 96Bit */
bogdanm 86:04dd9b1680ae 985 #define ETH_INTERFRAMEGAP_88BIT ((uint32_t)0x00020000) /*!< minimum IFG between frames during transmission is 88Bit */
bogdanm 86:04dd9b1680ae 986 #define ETH_INTERFRAMEGAP_80BIT ((uint32_t)0x00040000) /*!< minimum IFG between frames during transmission is 80Bit */
bogdanm 86:04dd9b1680ae 987 #define ETH_INTERFRAMEGAP_72BIT ((uint32_t)0x00060000) /*!< minimum IFG between frames during transmission is 72Bit */
bogdanm 86:04dd9b1680ae 988 #define ETH_INTERFRAMEGAP_64BIT ((uint32_t)0x00080000) /*!< minimum IFG between frames during transmission is 64Bit */
bogdanm 86:04dd9b1680ae 989 #define ETH_INTERFRAMEGAP_56BIT ((uint32_t)0x000A0000) /*!< minimum IFG between frames during transmission is 56Bit */
bogdanm 86:04dd9b1680ae 990 #define ETH_INTERFRAMEGAP_48BIT ((uint32_t)0x000C0000) /*!< minimum IFG between frames during transmission is 48Bit */
bogdanm 86:04dd9b1680ae 991 #define ETH_INTERFRAMEGAP_40BIT ((uint32_t)0x000E0000) /*!< minimum IFG between frames during transmission is 40Bit */
bogdanm 86:04dd9b1680ae 992 /**
bogdanm 86:04dd9b1680ae 993 * @}
bogdanm 86:04dd9b1680ae 994 */
bogdanm 86:04dd9b1680ae 995
Kojto 99:dbbf35b96557 996 /** @defgroup ETH_Carrier_Sense ETH Carrier Sense
bogdanm 86:04dd9b1680ae 997 * @{
bogdanm 86:04dd9b1680ae 998 */
bogdanm 86:04dd9b1680ae 999 #define ETH_CARRIERSENCE_ENABLE ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 1000 #define ETH_CARRIERSENCE_DISABLE ((uint32_t)0x00010000)
bogdanm 86:04dd9b1680ae 1001 /**
bogdanm 86:04dd9b1680ae 1002 * @}
bogdanm 86:04dd9b1680ae 1003 */
bogdanm 86:04dd9b1680ae 1004
Kojto 99:dbbf35b96557 1005 /** @defgroup ETH_Receive_Own ETH Receive Own
bogdanm 86:04dd9b1680ae 1006 * @{
bogdanm 86:04dd9b1680ae 1007 */
bogdanm 86:04dd9b1680ae 1008 #define ETH_RECEIVEOWN_ENABLE ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 1009 #define ETH_RECEIVEOWN_DISABLE ((uint32_t)0x00002000)
bogdanm 86:04dd9b1680ae 1010 /**
bogdanm 86:04dd9b1680ae 1011 * @}
bogdanm 86:04dd9b1680ae 1012 */
bogdanm 86:04dd9b1680ae 1013
Kojto 99:dbbf35b96557 1014 /** @defgroup ETH_Loop_Back_Mode ETH Loop Back Mode
bogdanm 86:04dd9b1680ae 1015 * @{
bogdanm 86:04dd9b1680ae 1016 */
bogdanm 86:04dd9b1680ae 1017 #define ETH_LOOPBACKMODE_ENABLE ((uint32_t)0x00001000)
bogdanm 86:04dd9b1680ae 1018 #define ETH_LOOPBACKMODE_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1019 /**
bogdanm 86:04dd9b1680ae 1020 * @}
bogdanm 86:04dd9b1680ae 1021 */
bogdanm 86:04dd9b1680ae 1022
Kojto 99:dbbf35b96557 1023 /** @defgroup ETH_Checksum_Offload ETH Checksum Offload
bogdanm 86:04dd9b1680ae 1024 * @{
bogdanm 86:04dd9b1680ae 1025 */
bogdanm 86:04dd9b1680ae 1026 #define ETH_CHECKSUMOFFLAOD_ENABLE ((uint32_t)0x00000400)
bogdanm 86:04dd9b1680ae 1027 #define ETH_CHECKSUMOFFLAOD_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1028 /**
bogdanm 86:04dd9b1680ae 1029 * @}
bogdanm 86:04dd9b1680ae 1030 */
bogdanm 86:04dd9b1680ae 1031
Kojto 99:dbbf35b96557 1032 /** @defgroup ETH_Retry_Transmission ETH Retry Transmission
bogdanm 86:04dd9b1680ae 1033 * @{
bogdanm 86:04dd9b1680ae 1034 */
bogdanm 86:04dd9b1680ae 1035 #define ETH_RETRYTRANSMISSION_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1036 #define ETH_RETRYTRANSMISSION_DISABLE ((uint32_t)0x00000200)
bogdanm 86:04dd9b1680ae 1037 /**
bogdanm 86:04dd9b1680ae 1038 * @}
bogdanm 86:04dd9b1680ae 1039 */
bogdanm 86:04dd9b1680ae 1040
Kojto 99:dbbf35b96557 1041 /** @defgroup ETH_Automatic_Pad_CRC_Strip ETH Automatic Pad CRC Strip
bogdanm 86:04dd9b1680ae 1042 * @{
bogdanm 86:04dd9b1680ae 1043 */
bogdanm 86:04dd9b1680ae 1044 #define ETH_AUTOMATICPADCRCSTRIP_ENABLE ((uint32_t)0x00000080)
bogdanm 86:04dd9b1680ae 1045 #define ETH_AUTOMATICPADCRCSTRIP_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1046 /**
bogdanm 86:04dd9b1680ae 1047 * @}
bogdanm 86:04dd9b1680ae 1048 */
bogdanm 86:04dd9b1680ae 1049
Kojto 99:dbbf35b96557 1050 /** @defgroup ETH_Back_Off_Limit ETH Back Off Limit
bogdanm 86:04dd9b1680ae 1051 * @{
bogdanm 86:04dd9b1680ae 1052 */
bogdanm 86:04dd9b1680ae 1053 #define ETH_BACKOFFLIMIT_10 ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1054 #define ETH_BACKOFFLIMIT_8 ((uint32_t)0x00000020)
bogdanm 86:04dd9b1680ae 1055 #define ETH_BACKOFFLIMIT_4 ((uint32_t)0x00000040)
bogdanm 86:04dd9b1680ae 1056 #define ETH_BACKOFFLIMIT_1 ((uint32_t)0x00000060)
bogdanm 86:04dd9b1680ae 1057 /**
bogdanm 86:04dd9b1680ae 1058 * @}
bogdanm 86:04dd9b1680ae 1059 */
bogdanm 86:04dd9b1680ae 1060
Kojto 99:dbbf35b96557 1061 /** @defgroup ETH_Deferral_Check ETH Deferral Check
bogdanm 86:04dd9b1680ae 1062 * @{
bogdanm 86:04dd9b1680ae 1063 */
bogdanm 86:04dd9b1680ae 1064 #define ETH_DEFFERRALCHECK_ENABLE ((uint32_t)0x00000010)
bogdanm 86:04dd9b1680ae 1065 #define ETH_DEFFERRALCHECK_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1066 /**
bogdanm 86:04dd9b1680ae 1067 * @}
bogdanm 86:04dd9b1680ae 1068 */
bogdanm 86:04dd9b1680ae 1069
Kojto 99:dbbf35b96557 1070 /** @defgroup ETH_Receive_All ETH Receive All
bogdanm 86:04dd9b1680ae 1071 * @{
bogdanm 86:04dd9b1680ae 1072 */
bogdanm 86:04dd9b1680ae 1073 #define ETH_RECEIVEALL_ENABLE ((uint32_t)0x80000000)
bogdanm 86:04dd9b1680ae 1074 #define ETH_RECEIVEAll_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1075 /**
bogdanm 86:04dd9b1680ae 1076 * @}
bogdanm 86:04dd9b1680ae 1077 */
bogdanm 86:04dd9b1680ae 1078
Kojto 99:dbbf35b96557 1079 /** @defgroup ETH_Source_Addr_Filter ETH Source Addr Filter
bogdanm 86:04dd9b1680ae 1080 * @{
bogdanm 86:04dd9b1680ae 1081 */
bogdanm 86:04dd9b1680ae 1082 #define ETH_SOURCEADDRFILTER_NORMAL_ENABLE ((uint32_t)0x00000200)
bogdanm 86:04dd9b1680ae 1083 #define ETH_SOURCEADDRFILTER_INVERSE_ENABLE ((uint32_t)0x00000300)
bogdanm 86:04dd9b1680ae 1084 #define ETH_SOURCEADDRFILTER_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1085 /**
bogdanm 86:04dd9b1680ae 1086 * @}
bogdanm 86:04dd9b1680ae 1087 */
bogdanm 86:04dd9b1680ae 1088
Kojto 99:dbbf35b96557 1089 /** @defgroup ETH_Pass_Control_Frames ETH Pass Control Frames
bogdanm 86:04dd9b1680ae 1090 * @{
bogdanm 86:04dd9b1680ae 1091 */
bogdanm 86:04dd9b1680ae 1092 #define ETH_PASSCONTROLFRAMES_BLOCKALL ((uint32_t)0x00000040) /*!< MAC filters all control frames from reaching the application */
bogdanm 86:04dd9b1680ae 1093 #define ETH_PASSCONTROLFRAMES_FORWARDALL ((uint32_t)0x00000080) /*!< MAC forwards all control frames to application even if they fail the Address Filter */
bogdanm 86:04dd9b1680ae 1094 #define ETH_PASSCONTROLFRAMES_FORWARDPASSEDADDRFILTER ((uint32_t)0x000000C0) /*!< MAC forwards control frames that pass the Address Filter. */
bogdanm 86:04dd9b1680ae 1095 /**
bogdanm 86:04dd9b1680ae 1096 * @}
bogdanm 86:04dd9b1680ae 1097 */
bogdanm 86:04dd9b1680ae 1098
Kojto 99:dbbf35b96557 1099 /** @defgroup ETH_Broadcast_Frames_Reception ETH Broadcast Frames Reception
bogdanm 86:04dd9b1680ae 1100 * @{
bogdanm 86:04dd9b1680ae 1101 */
bogdanm 86:04dd9b1680ae 1102 #define ETH_BROADCASTFRAMESRECEPTION_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1103 #define ETH_BROADCASTFRAMESRECEPTION_DISABLE ((uint32_t)0x00000020)
bogdanm 86:04dd9b1680ae 1104 /**
bogdanm 86:04dd9b1680ae 1105 * @}
bogdanm 86:04dd9b1680ae 1106 */
bogdanm 86:04dd9b1680ae 1107
Kojto 99:dbbf35b96557 1108 /** @defgroup ETH_Destination_Addr_Filter ETH Destination Addr Filter
bogdanm 86:04dd9b1680ae 1109 * @{
bogdanm 86:04dd9b1680ae 1110 */
bogdanm 86:04dd9b1680ae 1111 #define ETH_DESTINATIONADDRFILTER_NORMAL ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1112 #define ETH_DESTINATIONADDRFILTER_INVERSE ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 1113 /**
bogdanm 86:04dd9b1680ae 1114 * @}
bogdanm 86:04dd9b1680ae 1115 */
bogdanm 86:04dd9b1680ae 1116
Kojto 99:dbbf35b96557 1117 /** @defgroup ETH_Promiscuous_Mode ETH Promiscuous Mode
bogdanm 86:04dd9b1680ae 1118 * @{
bogdanm 86:04dd9b1680ae 1119 */
Kojto 99:dbbf35b96557 1120 #define ETH_PROMISCUOUS_MODE_ENABLE ((uint32_t)0x00000001)
Kojto 99:dbbf35b96557 1121 #define ETH_PROMISCUOUS_MODE_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1122 /**
bogdanm 86:04dd9b1680ae 1123 * @}
bogdanm 86:04dd9b1680ae 1124 */
bogdanm 86:04dd9b1680ae 1125
Kojto 99:dbbf35b96557 1126 /** @defgroup ETH_Multicast_Frames_Filter ETH Multicast Frames Filter
bogdanm 86:04dd9b1680ae 1127 * @{
bogdanm 86:04dd9b1680ae 1128 */
bogdanm 86:04dd9b1680ae 1129 #define ETH_MULTICASTFRAMESFILTER_PERFECTHASHTABLE ((uint32_t)0x00000404)
bogdanm 86:04dd9b1680ae 1130 #define ETH_MULTICASTFRAMESFILTER_HASHTABLE ((uint32_t)0x00000004)
bogdanm 86:04dd9b1680ae 1131 #define ETH_MULTICASTFRAMESFILTER_PERFECT ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1132 #define ETH_MULTICASTFRAMESFILTER_NONE ((uint32_t)0x00000010)
bogdanm 86:04dd9b1680ae 1133 /**
bogdanm 86:04dd9b1680ae 1134 * @}
bogdanm 86:04dd9b1680ae 1135 */
bogdanm 86:04dd9b1680ae 1136
Kojto 99:dbbf35b96557 1137 /** @defgroup ETH_Unicast_Frames_Filter ETH Unicast Frames Filter
bogdanm 86:04dd9b1680ae 1138 * @{
bogdanm 86:04dd9b1680ae 1139 */
bogdanm 86:04dd9b1680ae 1140 #define ETH_UNICASTFRAMESFILTER_PERFECTHASHTABLE ((uint32_t)0x00000402)
bogdanm 86:04dd9b1680ae 1141 #define ETH_UNICASTFRAMESFILTER_HASHTABLE ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 1142 #define ETH_UNICASTFRAMESFILTER_PERFECT ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1143 /**
bogdanm 86:04dd9b1680ae 1144 * @}
bogdanm 86:04dd9b1680ae 1145 */
bogdanm 86:04dd9b1680ae 1146
Kojto 99:dbbf35b96557 1147 /** @defgroup ETH_Zero_Quanta_Pause ETH Zero Quanta Pause
bogdanm 86:04dd9b1680ae 1148 * @{
bogdanm 86:04dd9b1680ae 1149 */
Kojto 99:dbbf35b96557 1150 #define ETH_ZEROQUANTAPAUSE_ENABLE ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 1151 #define ETH_ZEROQUANTAPAUSE_DISABLE ((uint32_t)0x00000080)
bogdanm 86:04dd9b1680ae 1152 /**
bogdanm 86:04dd9b1680ae 1153 * @}
bogdanm 86:04dd9b1680ae 1154 */
bogdanm 86:04dd9b1680ae 1155
Kojto 99:dbbf35b96557 1156 /** @defgroup ETH_Pause_Low_Threshold ETH Pause Low Threshold
bogdanm 86:04dd9b1680ae 1157 * @{
bogdanm 86:04dd9b1680ae 1158 */
bogdanm 86:04dd9b1680ae 1159 #define ETH_PAUSELOWTHRESHOLD_MINUS4 ((uint32_t)0x00000000) /*!< Pause time minus 4 slot times */
bogdanm 86:04dd9b1680ae 1160 #define ETH_PAUSELOWTHRESHOLD_MINUS28 ((uint32_t)0x00000010) /*!< Pause time minus 28 slot times */
bogdanm 86:04dd9b1680ae 1161 #define ETH_PAUSELOWTHRESHOLD_MINUS144 ((uint32_t)0x00000020) /*!< Pause time minus 144 slot times */
bogdanm 86:04dd9b1680ae 1162 #define ETH_PAUSELOWTHRESHOLD_MINUS256 ((uint32_t)0x00000030) /*!< Pause time minus 256 slot times */
bogdanm 86:04dd9b1680ae 1163 /**
bogdanm 86:04dd9b1680ae 1164 * @}
bogdanm 86:04dd9b1680ae 1165 */
bogdanm 86:04dd9b1680ae 1166
Kojto 99:dbbf35b96557 1167 /** @defgroup ETH_Unicast_Pause_Frame_Detect ETH Unicast Pause Frame Detect
bogdanm 86:04dd9b1680ae 1168 * @{
bogdanm 86:04dd9b1680ae 1169 */
bogdanm 86:04dd9b1680ae 1170 #define ETH_UNICASTPAUSEFRAMEDETECT_ENABLE ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 1171 #define ETH_UNICASTPAUSEFRAMEDETECT_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1172 /**
bogdanm 86:04dd9b1680ae 1173 * @}
bogdanm 86:04dd9b1680ae 1174 */
bogdanm 86:04dd9b1680ae 1175
Kojto 99:dbbf35b96557 1176 /** @defgroup ETH_Receive_Flow_Control ETH Receive Flow Control
bogdanm 86:04dd9b1680ae 1177 * @{
bogdanm 86:04dd9b1680ae 1178 */
bogdanm 86:04dd9b1680ae 1179 #define ETH_RECEIVEFLOWCONTROL_ENABLE ((uint32_t)0x00000004)
bogdanm 86:04dd9b1680ae 1180 #define ETH_RECEIVEFLOWCONTROL_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1181 /**
bogdanm 86:04dd9b1680ae 1182 * @}
bogdanm 86:04dd9b1680ae 1183 */
bogdanm 86:04dd9b1680ae 1184
Kojto 99:dbbf35b96557 1185 /** @defgroup ETH_Transmit_Flow_Control ETH Transmit Flow Control
bogdanm 86:04dd9b1680ae 1186 * @{
bogdanm 86:04dd9b1680ae 1187 */
bogdanm 86:04dd9b1680ae 1188 #define ETH_TRANSMITFLOWCONTROL_ENABLE ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 1189 #define ETH_TRANSMITFLOWCONTROL_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1190 /**
bogdanm 86:04dd9b1680ae 1191 * @}
bogdanm 86:04dd9b1680ae 1192 */
bogdanm 86:04dd9b1680ae 1193
Kojto 99:dbbf35b96557 1194 /** @defgroup ETH_VLAN_Tag_Comparison ETH VLAN Tag Comparison
bogdanm 86:04dd9b1680ae 1195 * @{
bogdanm 86:04dd9b1680ae 1196 */
bogdanm 86:04dd9b1680ae 1197 #define ETH_VLANTAGCOMPARISON_12BIT ((uint32_t)0x00010000)
bogdanm 86:04dd9b1680ae 1198 #define ETH_VLANTAGCOMPARISON_16BIT ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1199 /**
bogdanm 86:04dd9b1680ae 1200 * @}
bogdanm 86:04dd9b1680ae 1201 */
bogdanm 86:04dd9b1680ae 1202
Kojto 99:dbbf35b96557 1203 /** @defgroup ETH_MAC_addresses ETH MAC addresses
bogdanm 86:04dd9b1680ae 1204 * @{
bogdanm 86:04dd9b1680ae 1205 */
bogdanm 86:04dd9b1680ae 1206 #define ETH_MAC_ADDRESS0 ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1207 #define ETH_MAC_ADDRESS1 ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 1208 #define ETH_MAC_ADDRESS2 ((uint32_t)0x00000010)
bogdanm 86:04dd9b1680ae 1209 #define ETH_MAC_ADDRESS3 ((uint32_t)0x00000018)
bogdanm 86:04dd9b1680ae 1210 /**
bogdanm 86:04dd9b1680ae 1211 * @}
bogdanm 86:04dd9b1680ae 1212 */
bogdanm 86:04dd9b1680ae 1213
Kojto 99:dbbf35b96557 1214 /** @defgroup ETH_MAC_addresses_filter_SA_DA ETH MAC addresses filter SA DA
bogdanm 86:04dd9b1680ae 1215 * @{
bogdanm 86:04dd9b1680ae 1216 */
bogdanm 86:04dd9b1680ae 1217 #define ETH_MAC_ADDRESSFILTER_SA ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1218 #define ETH_MAC_ADDRESSFILTER_DA ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 1219 /**
bogdanm 86:04dd9b1680ae 1220 * @}
bogdanm 86:04dd9b1680ae 1221 */
bogdanm 86:04dd9b1680ae 1222
Kojto 99:dbbf35b96557 1223 /** @defgroup ETH_MAC_addresses_filter_Mask_bytes ETH MAC addresses filter Mask bytes
bogdanm 86:04dd9b1680ae 1224 * @{
bogdanm 86:04dd9b1680ae 1225 */
bogdanm 86:04dd9b1680ae 1226 #define ETH_MAC_ADDRESSMASK_BYTE6 ((uint32_t)0x20000000) /*!< Mask MAC Address high reg bits [15:8] */
bogdanm 86:04dd9b1680ae 1227 #define ETH_MAC_ADDRESSMASK_BYTE5 ((uint32_t)0x10000000) /*!< Mask MAC Address high reg bits [7:0] */
bogdanm 86:04dd9b1680ae 1228 #define ETH_MAC_ADDRESSMASK_BYTE4 ((uint32_t)0x08000000) /*!< Mask MAC Address low reg bits [31:24] */
bogdanm 86:04dd9b1680ae 1229 #define ETH_MAC_ADDRESSMASK_BYTE3 ((uint32_t)0x04000000) /*!< Mask MAC Address low reg bits [23:16] */
bogdanm 86:04dd9b1680ae 1230 #define ETH_MAC_ADDRESSMASK_BYTE2 ((uint32_t)0x02000000) /*!< Mask MAC Address low reg bits [15:8] */
bogdanm 86:04dd9b1680ae 1231 #define ETH_MAC_ADDRESSMASK_BYTE1 ((uint32_t)0x01000000) /*!< Mask MAC Address low reg bits [70] */
bogdanm 86:04dd9b1680ae 1232 /**
bogdanm 86:04dd9b1680ae 1233 * @}
bogdanm 86:04dd9b1680ae 1234 */
bogdanm 86:04dd9b1680ae 1235
Kojto 99:dbbf35b96557 1236 /** @defgroup ETH_MAC_Debug_flags ETH MAC Debug flags
bogdanm 86:04dd9b1680ae 1237 * @{
bogdanm 86:04dd9b1680ae 1238 */
bogdanm 86:04dd9b1680ae 1239 #define ETH_MAC_TXFIFO_FULL ((uint32_t)0x02000000) /* Tx FIFO full */
bogdanm 86:04dd9b1680ae 1240 #define ETH_MAC_TXFIFONOT_EMPTY ((uint32_t)0x01000000) /* Tx FIFO not empty */
bogdanm 86:04dd9b1680ae 1241 #define ETH_MAC_TXFIFO_WRITE_ACTIVE ((uint32_t)0x00400000) /* Tx FIFO write active */
bogdanm 86:04dd9b1680ae 1242 #define ETH_MAC_TXFIFO_IDLE ((uint32_t)0x00000000) /* Tx FIFO read status: Idle */
bogdanm 86:04dd9b1680ae 1243 #define ETH_MAC_TXFIFO_READ ((uint32_t)0x00100000) /* Tx FIFO read status: Read (transferring data to the MAC transmitter) */
bogdanm 86:04dd9b1680ae 1244 #define ETH_MAC_TXFIFO_WAITING ((uint32_t)0x00200000) /* Tx FIFO read status: Waiting for TxStatus from MAC transmitter */
bogdanm 86:04dd9b1680ae 1245 #define ETH_MAC_TXFIFO_WRITING ((uint32_t)0x00300000) /* Tx FIFO read status: Writing the received TxStatus or flushing the TxFIFO */
bogdanm 86:04dd9b1680ae 1246 #define ETH_MAC_TRANSMISSION_PAUSE ((uint32_t)0x00080000) /* MAC transmitter in pause */
bogdanm 86:04dd9b1680ae 1247 #define ETH_MAC_TRANSMITFRAMECONTROLLER_IDLE ((uint32_t)0x00000000) /* MAC transmit frame controller: Idle */
bogdanm 86:04dd9b1680ae 1248 #define ETH_MAC_TRANSMITFRAMECONTROLLER_WAITING ((uint32_t)0x00020000) /* MAC transmit frame controller: Waiting for Status of previous frame or IFG/backoff period to be over */
bogdanm 86:04dd9b1680ae 1249 #define ETH_MAC_TRANSMITFRAMECONTROLLER_GENRATING_PCF ((uint32_t)0x00040000) /* MAC transmit frame controller: Generating and transmitting a Pause control frame (in full duplex mode) */
bogdanm 86:04dd9b1680ae 1250 #define ETH_MAC_TRANSMITFRAMECONTROLLER_TRANSFERRING ((uint32_t)0x00060000) /* MAC transmit frame controller: Transferring input frame for transmission */
bogdanm 86:04dd9b1680ae 1251 #define ETH_MAC_MII_TRANSMIT_ACTIVE ((uint32_t)0x00010000) /* MAC MII transmit engine active */
bogdanm 86:04dd9b1680ae 1252 #define ETH_MAC_RXFIFO_EMPTY ((uint32_t)0x00000000) /* Rx FIFO fill level: empty */
bogdanm 86:04dd9b1680ae 1253 #define ETH_MAC_RXFIFO_BELOW_THRESHOLD ((uint32_t)0x00000100) /* Rx FIFO fill level: fill-level below flow-control de-activate threshold */
bogdanm 86:04dd9b1680ae 1254 #define ETH_MAC_RXFIFO_ABOVE_THRESHOLD ((uint32_t)0x00000200) /* Rx FIFO fill level: fill-level above flow-control activate threshold */
bogdanm 86:04dd9b1680ae 1255 #define ETH_MAC_RXFIFO_FULL ((uint32_t)0x00000300) /* Rx FIFO fill level: full */
Kojto 106:ba1f97679dad 1256 #define ETH_MAC_READCONTROLLER_IDLE ((uint32_t)0x00000000) /* Rx FIFO read controller IDLE state */
Kojto 106:ba1f97679dad 1257 #define ETH_MAC_READCONTROLLER_READING_DATA ((uint32_t)0x00000020) /* Rx FIFO read controller Reading frame data */
Kojto 106:ba1f97679dad 1258 #define ETH_MAC_READCONTROLLER_READING_STATUS ((uint32_t)0x00000040) /* Rx FIFO read controller Reading frame status (or time-stamp) */
Kojto 106:ba1f97679dad 1259 #define ETH_MAC_READCONTROLLER_FLUSHING ((uint32_t)0x00000060) /* Rx FIFO read controller Flushing the frame data and status */
bogdanm 86:04dd9b1680ae 1260 #define ETH_MAC_RXFIFO_WRITE_ACTIVE ((uint32_t)0x00000010) /* Rx FIFO write controller active */
bogdanm 86:04dd9b1680ae 1261 #define ETH_MAC_SMALL_FIFO_NOTACTIVE ((uint32_t)0x00000000) /* MAC small FIFO read / write controllers not active */
bogdanm 86:04dd9b1680ae 1262 #define ETH_MAC_SMALL_FIFO_READ_ACTIVE ((uint32_t)0x00000002) /* MAC small FIFO read controller active */
bogdanm 86:04dd9b1680ae 1263 #define ETH_MAC_SMALL_FIFO_WRITE_ACTIVE ((uint32_t)0x00000004) /* MAC small FIFO write controller active */
bogdanm 86:04dd9b1680ae 1264 #define ETH_MAC_SMALL_FIFO_RW_ACTIVE ((uint32_t)0x00000006) /* MAC small FIFO read / write controllers active */
Kojto 99:dbbf35b96557 1265 #define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE ((uint32_t)0x00000001) /* MAC MII receive protocol engine active */
bogdanm 86:04dd9b1680ae 1266 /**
bogdanm 86:04dd9b1680ae 1267 * @}
bogdanm 86:04dd9b1680ae 1268 */
bogdanm 86:04dd9b1680ae 1269
Kojto 99:dbbf35b96557 1270 /** @defgroup ETH_Drop_TCP_IP_Checksum_Error_Frame ETH Drop TCP IP Checksum Error Frame
bogdanm 86:04dd9b1680ae 1271 * @{
bogdanm 86:04dd9b1680ae 1272 */
bogdanm 86:04dd9b1680ae 1273 #define ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1274 #define ETH_DROPTCPIPCHECKSUMERRORFRAME_DISABLE ((uint32_t)0x04000000)
bogdanm 86:04dd9b1680ae 1275 /**
bogdanm 86:04dd9b1680ae 1276 * @}
bogdanm 86:04dd9b1680ae 1277 */
bogdanm 86:04dd9b1680ae 1278
Kojto 99:dbbf35b96557 1279 /** @defgroup ETH_Receive_Store_Forward ETH Receive Store Forward
bogdanm 86:04dd9b1680ae 1280 * @{
bogdanm 86:04dd9b1680ae 1281 */
bogdanm 86:04dd9b1680ae 1282 #define ETH_RECEIVESTOREFORWARD_ENABLE ((uint32_t)0x02000000)
bogdanm 86:04dd9b1680ae 1283 #define ETH_RECEIVESTOREFORWARD_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1284 /**
bogdanm 86:04dd9b1680ae 1285 * @}
bogdanm 86:04dd9b1680ae 1286 */
bogdanm 86:04dd9b1680ae 1287
Kojto 99:dbbf35b96557 1288 /** @defgroup ETH_Flush_Received_Frame ETH Flush Received Frame
bogdanm 86:04dd9b1680ae 1289 * @{
bogdanm 86:04dd9b1680ae 1290 */
bogdanm 86:04dd9b1680ae 1291 #define ETH_FLUSHRECEIVEDFRAME_ENABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1292 #define ETH_FLUSHRECEIVEDFRAME_DISABLE ((uint32_t)0x01000000)
bogdanm 86:04dd9b1680ae 1293 /**
bogdanm 86:04dd9b1680ae 1294 * @}
bogdanm 86:04dd9b1680ae 1295 */
bogdanm 86:04dd9b1680ae 1296
Kojto 99:dbbf35b96557 1297 /** @defgroup ETH_Transmit_Store_Forward ETH Transmit Store Forward
bogdanm 86:04dd9b1680ae 1298 * @{
bogdanm 86:04dd9b1680ae 1299 */
bogdanm 86:04dd9b1680ae 1300 #define ETH_TRANSMITSTOREFORWARD_ENABLE ((uint32_t)0x00200000)
bogdanm 86:04dd9b1680ae 1301 #define ETH_TRANSMITSTOREFORWARD_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1302 /**
bogdanm 86:04dd9b1680ae 1303 * @}
bogdanm 86:04dd9b1680ae 1304 */
bogdanm 86:04dd9b1680ae 1305
Kojto 99:dbbf35b96557 1306 /** @defgroup ETH_Transmit_Threshold_Control ETH Transmit Threshold Control
bogdanm 86:04dd9b1680ae 1307 * @{
bogdanm 86:04dd9b1680ae 1308 */
bogdanm 86:04dd9b1680ae 1309 #define ETH_TRANSMITTHRESHOLDCONTROL_64BYTES ((uint32_t)0x00000000) /*!< threshold level of the MTL Transmit FIFO is 64 Bytes */
bogdanm 86:04dd9b1680ae 1310 #define ETH_TRANSMITTHRESHOLDCONTROL_128BYTES ((uint32_t)0x00004000) /*!< threshold level of the MTL Transmit FIFO is 128 Bytes */
bogdanm 86:04dd9b1680ae 1311 #define ETH_TRANSMITTHRESHOLDCONTROL_192BYTES ((uint32_t)0x00008000) /*!< threshold level of the MTL Transmit FIFO is 192 Bytes */
bogdanm 86:04dd9b1680ae 1312 #define ETH_TRANSMITTHRESHOLDCONTROL_256BYTES ((uint32_t)0x0000C000) /*!< threshold level of the MTL Transmit FIFO is 256 Bytes */
bogdanm 86:04dd9b1680ae 1313 #define ETH_TRANSMITTHRESHOLDCONTROL_40BYTES ((uint32_t)0x00010000) /*!< threshold level of the MTL Transmit FIFO is 40 Bytes */
bogdanm 86:04dd9b1680ae 1314 #define ETH_TRANSMITTHRESHOLDCONTROL_32BYTES ((uint32_t)0x00014000) /*!< threshold level of the MTL Transmit FIFO is 32 Bytes */
bogdanm 86:04dd9b1680ae 1315 #define ETH_TRANSMITTHRESHOLDCONTROL_24BYTES ((uint32_t)0x00018000) /*!< threshold level of the MTL Transmit FIFO is 24 Bytes */
bogdanm 86:04dd9b1680ae 1316 #define ETH_TRANSMITTHRESHOLDCONTROL_16BYTES ((uint32_t)0x0001C000) /*!< threshold level of the MTL Transmit FIFO is 16 Bytes */
bogdanm 86:04dd9b1680ae 1317 /**
bogdanm 86:04dd9b1680ae 1318 * @}
bogdanm 86:04dd9b1680ae 1319 */
bogdanm 86:04dd9b1680ae 1320
Kojto 99:dbbf35b96557 1321 /** @defgroup ETH_Forward_Error_Frames ETH Forward Error Frames
bogdanm 86:04dd9b1680ae 1322 * @{
bogdanm 86:04dd9b1680ae 1323 */
bogdanm 86:04dd9b1680ae 1324 #define ETH_FORWARDERRORFRAMES_ENABLE ((uint32_t)0x00000080)
bogdanm 86:04dd9b1680ae 1325 #define ETH_FORWARDERRORFRAMES_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1326 /**
bogdanm 86:04dd9b1680ae 1327 * @}
bogdanm 86:04dd9b1680ae 1328 */
bogdanm 86:04dd9b1680ae 1329
Kojto 99:dbbf35b96557 1330 /** @defgroup ETH_Forward_Undersized_Good_Frames ETH Forward Undersized Good Frames
bogdanm 86:04dd9b1680ae 1331 * @{
bogdanm 86:04dd9b1680ae 1332 */
bogdanm 86:04dd9b1680ae 1333 #define ETH_FORWARDUNDERSIZEDGOODFRAMES_ENABLE ((uint32_t)0x00000040)
bogdanm 86:04dd9b1680ae 1334 #define ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1335 /**
bogdanm 86:04dd9b1680ae 1336 * @}
bogdanm 86:04dd9b1680ae 1337 */
bogdanm 86:04dd9b1680ae 1338
Kojto 99:dbbf35b96557 1339 /** @defgroup ETH_Receive_Threshold_Control ETH Receive Threshold Control
bogdanm 86:04dd9b1680ae 1340 * @{
bogdanm 86:04dd9b1680ae 1341 */
bogdanm 86:04dd9b1680ae 1342 #define ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES ((uint32_t)0x00000000) /*!< threshold level of the MTL Receive FIFO is 64 Bytes */
bogdanm 86:04dd9b1680ae 1343 #define ETH_RECEIVEDTHRESHOLDCONTROL_32BYTES ((uint32_t)0x00000008) /*!< threshold level of the MTL Receive FIFO is 32 Bytes */
bogdanm 86:04dd9b1680ae 1344 #define ETH_RECEIVEDTHRESHOLDCONTROL_96BYTES ((uint32_t)0x00000010) /*!< threshold level of the MTL Receive FIFO is 96 Bytes */
bogdanm 86:04dd9b1680ae 1345 #define ETH_RECEIVEDTHRESHOLDCONTROL_128BYTES ((uint32_t)0x00000018) /*!< threshold level of the MTL Receive FIFO is 128 Bytes */
bogdanm 86:04dd9b1680ae 1346 /**
bogdanm 86:04dd9b1680ae 1347 * @}
bogdanm 86:04dd9b1680ae 1348 */
bogdanm 86:04dd9b1680ae 1349
Kojto 99:dbbf35b96557 1350 /** @defgroup ETH_Second_Frame_Operate ETH Second Frame Operate
bogdanm 86:04dd9b1680ae 1351 * @{
bogdanm 86:04dd9b1680ae 1352 */
bogdanm 86:04dd9b1680ae 1353 #define ETH_SECONDFRAMEOPERARTE_ENABLE ((uint32_t)0x00000004)
bogdanm 86:04dd9b1680ae 1354 #define ETH_SECONDFRAMEOPERARTE_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1355 /**
bogdanm 86:04dd9b1680ae 1356 * @}
bogdanm 86:04dd9b1680ae 1357 */
bogdanm 86:04dd9b1680ae 1358
Kojto 99:dbbf35b96557 1359 /** @defgroup ETH_Address_Aligned_Beats ETH Address Aligned Beats
bogdanm 86:04dd9b1680ae 1360 * @{
bogdanm 86:04dd9b1680ae 1361 */
bogdanm 86:04dd9b1680ae 1362 #define ETH_ADDRESSALIGNEDBEATS_ENABLE ((uint32_t)0x02000000)
bogdanm 86:04dd9b1680ae 1363 #define ETH_ADDRESSALIGNEDBEATS_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1364 /**
bogdanm 86:04dd9b1680ae 1365 * @}
bogdanm 86:04dd9b1680ae 1366 */
bogdanm 86:04dd9b1680ae 1367
Kojto 99:dbbf35b96557 1368 /** @defgroup ETH_Fixed_Burst ETH Fixed Burst
bogdanm 86:04dd9b1680ae 1369 * @{
bogdanm 86:04dd9b1680ae 1370 */
bogdanm 86:04dd9b1680ae 1371 #define ETH_FIXEDBURST_ENABLE ((uint32_t)0x00010000)
bogdanm 86:04dd9b1680ae 1372 #define ETH_FIXEDBURST_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1373 /**
bogdanm 86:04dd9b1680ae 1374 * @}
bogdanm 86:04dd9b1680ae 1375 */
bogdanm 86:04dd9b1680ae 1376
Kojto 99:dbbf35b96557 1377 /** @defgroup ETH_Rx_DMA_Burst_Length ETH Rx DMA Burst Length
bogdanm 86:04dd9b1680ae 1378 * @{
bogdanm 86:04dd9b1680ae 1379 */
bogdanm 86:04dd9b1680ae 1380 #define ETH_RXDMABURSTLENGTH_1BEAT ((uint32_t)0x00020000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 1 */
bogdanm 86:04dd9b1680ae 1381 #define ETH_RXDMABURSTLENGTH_2BEAT ((uint32_t)0x00040000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 2 */
bogdanm 86:04dd9b1680ae 1382 #define ETH_RXDMABURSTLENGTH_4BEAT ((uint32_t)0x00080000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 4 */
bogdanm 86:04dd9b1680ae 1383 #define ETH_RXDMABURSTLENGTH_8BEAT ((uint32_t)0x00100000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 8 */
bogdanm 86:04dd9b1680ae 1384 #define ETH_RXDMABURSTLENGTH_16BEAT ((uint32_t)0x00200000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 16 */
bogdanm 86:04dd9b1680ae 1385 #define ETH_RXDMABURSTLENGTH_32BEAT ((uint32_t)0x00400000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 32 */
bogdanm 86:04dd9b1680ae 1386 #define ETH_RXDMABURSTLENGTH_4XPBL_4BEAT ((uint32_t)0x01020000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 4 */
bogdanm 86:04dd9b1680ae 1387 #define ETH_RXDMABURSTLENGTH_4XPBL_8BEAT ((uint32_t)0x01040000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 8 */
bogdanm 86:04dd9b1680ae 1388 #define ETH_RXDMABURSTLENGTH_4XPBL_16BEAT ((uint32_t)0x01080000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 16 */
bogdanm 86:04dd9b1680ae 1389 #define ETH_RXDMABURSTLENGTH_4XPBL_32BEAT ((uint32_t)0x01100000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 32 */
bogdanm 86:04dd9b1680ae 1390 #define ETH_RXDMABURSTLENGTH_4XPBL_64BEAT ((uint32_t)0x01200000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 64 */
bogdanm 86:04dd9b1680ae 1391 #define ETH_RXDMABURSTLENGTH_4XPBL_128BEAT ((uint32_t)0x01400000) /*!< maximum number of beats to be transferred in one RxDMA transaction is 128 */
bogdanm 86:04dd9b1680ae 1392 /**
bogdanm 86:04dd9b1680ae 1393 * @}
bogdanm 86:04dd9b1680ae 1394 */
bogdanm 86:04dd9b1680ae 1395
Kojto 99:dbbf35b96557 1396 /** @defgroup ETH_Tx_DMA_Burst_Length ETH Tx DMA Burst Length
bogdanm 86:04dd9b1680ae 1397 * @{
bogdanm 86:04dd9b1680ae 1398 */
bogdanm 86:04dd9b1680ae 1399 #define ETH_TXDMABURSTLENGTH_1BEAT ((uint32_t)0x00000100) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
bogdanm 86:04dd9b1680ae 1400 #define ETH_TXDMABURSTLENGTH_2BEAT ((uint32_t)0x00000200) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
bogdanm 86:04dd9b1680ae 1401 #define ETH_TXDMABURSTLENGTH_4BEAT ((uint32_t)0x00000400) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
bogdanm 86:04dd9b1680ae 1402 #define ETH_TXDMABURSTLENGTH_8BEAT ((uint32_t)0x00000800) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
bogdanm 86:04dd9b1680ae 1403 #define ETH_TXDMABURSTLENGTH_16BEAT ((uint32_t)0x00001000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
bogdanm 86:04dd9b1680ae 1404 #define ETH_TXDMABURSTLENGTH_32BEAT ((uint32_t)0x00002000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
bogdanm 86:04dd9b1680ae 1405 #define ETH_TXDMABURSTLENGTH_4XPBL_4BEAT ((uint32_t)0x01000100) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
bogdanm 86:04dd9b1680ae 1406 #define ETH_TXDMABURSTLENGTH_4XPBL_8BEAT ((uint32_t)0x01000200) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
bogdanm 86:04dd9b1680ae 1407 #define ETH_TXDMABURSTLENGTH_4XPBL_16BEAT ((uint32_t)0x01000400) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
bogdanm 86:04dd9b1680ae 1408 #define ETH_TXDMABURSTLENGTH_4XPBL_32BEAT ((uint32_t)0x01000800) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
bogdanm 86:04dd9b1680ae 1409 #define ETH_TXDMABURSTLENGTH_4XPBL_64BEAT ((uint32_t)0x01001000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
bogdanm 86:04dd9b1680ae 1410 #define ETH_TXDMABURSTLENGTH_4XPBL_128BEAT ((uint32_t)0x01002000) /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
Kojto 99:dbbf35b96557 1411 /**
Kojto 99:dbbf35b96557 1412 * @}
Kojto 99:dbbf35b96557 1413 */
bogdanm 86:04dd9b1680ae 1414
Kojto 99:dbbf35b96557 1415 /** @defgroup ETH_DMA_Enhanced_descriptor_format ETH DMA Enhanced descriptor format
bogdanm 86:04dd9b1680ae 1416 * @{
bogdanm 86:04dd9b1680ae 1417 */
bogdanm 86:04dd9b1680ae 1418 #define ETH_DMAENHANCEDDESCRIPTOR_ENABLE ((uint32_t)0x00000080)
bogdanm 86:04dd9b1680ae 1419 #define ETH_DMAENHANCEDDESCRIPTOR_DISABLE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1420 /**
bogdanm 86:04dd9b1680ae 1421 * @}
bogdanm 86:04dd9b1680ae 1422 */
bogdanm 86:04dd9b1680ae 1423
Kojto 99:dbbf35b96557 1424 /** @defgroup ETH_DMA_Arbitration ETH DMA Arbitration
bogdanm 86:04dd9b1680ae 1425 * @{
bogdanm 86:04dd9b1680ae 1426 */
bogdanm 86:04dd9b1680ae 1427 #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1 ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 1428 #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_2_1 ((uint32_t)0x00004000)
bogdanm 86:04dd9b1680ae 1429 #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_3_1 ((uint32_t)0x00008000)
bogdanm 86:04dd9b1680ae 1430 #define ETH_DMAARBITRATION_ROUNDROBIN_RXTX_4_1 ((uint32_t)0x0000C000)
bogdanm 86:04dd9b1680ae 1431 #define ETH_DMAARBITRATION_RXPRIORTX ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 1432 /**
bogdanm 86:04dd9b1680ae 1433 * @}
bogdanm 86:04dd9b1680ae 1434 */
bogdanm 86:04dd9b1680ae 1435
Kojto 99:dbbf35b96557 1436 /** @defgroup ETH_DMA_Tx_descriptor_segment ETH DMA Tx descriptor segment
bogdanm 86:04dd9b1680ae 1437 * @{
bogdanm 86:04dd9b1680ae 1438 */
Kojto 99:dbbf35b96557 1439 #define ETH_DMATXDESC_LASTSEGMENTS ((uint32_t)0x40000000) /*!< Last Segment */
Kojto 99:dbbf35b96557 1440 #define ETH_DMATXDESC_FIRSTSEGMENT ((uint32_t)0x20000000) /*!< First Segment */
bogdanm 86:04dd9b1680ae 1441 /**
bogdanm 86:04dd9b1680ae 1442 * @}
bogdanm 86:04dd9b1680ae 1443 */
bogdanm 86:04dd9b1680ae 1444
Kojto 99:dbbf35b96557 1445 /** @defgroup ETH_DMA_Tx_descriptor_Checksum_Insertion_Control ETH DMA Tx descriptor Checksum Insertion Control
bogdanm 86:04dd9b1680ae 1446 * @{
bogdanm 86:04dd9b1680ae 1447 */
bogdanm 86:04dd9b1680ae 1448 #define ETH_DMATXDESC_CHECKSUMBYPASS ((uint32_t)0x00000000) /*!< Checksum engine bypass */
bogdanm 86:04dd9b1680ae 1449 #define ETH_DMATXDESC_CHECKSUMIPV4HEADER ((uint32_t)0x00400000) /*!< IPv4 header checksum insertion */
bogdanm 86:04dd9b1680ae 1450 #define ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT ((uint32_t)0x00800000) /*!< TCP/UDP/ICMP checksum insertion. Pseudo header checksum is assumed to be present */
bogdanm 86:04dd9b1680ae 1451 #define ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL ((uint32_t)0x00C00000) /*!< TCP/UDP/ICMP checksum fully in hardware including pseudo header */
bogdanm 86:04dd9b1680ae 1452 /**
bogdanm 86:04dd9b1680ae 1453 * @}
bogdanm 86:04dd9b1680ae 1454 */
bogdanm 86:04dd9b1680ae 1455
Kojto 99:dbbf35b96557 1456 /** @defgroup ETH_DMA_Rx_descriptor_buffers ETH DMA Rx descriptor buffers
bogdanm 86:04dd9b1680ae 1457 * @{
bogdanm 86:04dd9b1680ae 1458 */
Kojto 99:dbbf35b96557 1459 #define ETH_DMARXDESC_BUFFER1 ((uint32_t)0x00000000) /*!< DMA Rx Desc Buffer1 */
Kojto 99:dbbf35b96557 1460 #define ETH_DMARXDESC_BUFFER2 ((uint32_t)0x00000001) /*!< DMA Rx Desc Buffer2 */
bogdanm 86:04dd9b1680ae 1461 /**
bogdanm 86:04dd9b1680ae 1462 * @}
bogdanm 86:04dd9b1680ae 1463 */
bogdanm 86:04dd9b1680ae 1464
Kojto 99:dbbf35b96557 1465 /** @defgroup ETH_PMT_Flags ETH PMT Flags
bogdanm 86:04dd9b1680ae 1466 * @{
bogdanm 86:04dd9b1680ae 1467 */
bogdanm 86:04dd9b1680ae 1468 #define ETH_PMT_FLAG_WUFFRPR ((uint32_t)0x80000000) /*!< Wake-Up Frame Filter Register Pointer Reset */
bogdanm 86:04dd9b1680ae 1469 #define ETH_PMT_FLAG_WUFR ((uint32_t)0x00000040) /*!< Wake-Up Frame Received */
bogdanm 86:04dd9b1680ae 1470 #define ETH_PMT_FLAG_MPR ((uint32_t)0x00000020) /*!< Magic Packet Received */
bogdanm 86:04dd9b1680ae 1471 /**
bogdanm 86:04dd9b1680ae 1472 * @}
bogdanm 86:04dd9b1680ae 1473 */
bogdanm 86:04dd9b1680ae 1474
Kojto 99:dbbf35b96557 1475 /** @defgroup ETH_MMC_Tx_Interrupts ETH MMC Tx Interrupts
bogdanm 86:04dd9b1680ae 1476 * @{
bogdanm 86:04dd9b1680ae 1477 */
bogdanm 86:04dd9b1680ae 1478 #define ETH_MMC_IT_TGF ((uint32_t)0x00200000) /*!< When Tx good frame counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1479 #define ETH_MMC_IT_TGFMSC ((uint32_t)0x00008000) /*!< When Tx good multi col counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1480 #define ETH_MMC_IT_TGFSC ((uint32_t)0x00004000) /*!< When Tx good single col counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1481 /**
bogdanm 86:04dd9b1680ae 1482 * @}
bogdanm 86:04dd9b1680ae 1483 */
bogdanm 86:04dd9b1680ae 1484
Kojto 99:dbbf35b96557 1485 /** @defgroup ETH_MMC_Rx_Interrupts ETH MMC Rx Interrupts
bogdanm 86:04dd9b1680ae 1486 * @{
bogdanm 86:04dd9b1680ae 1487 */
bogdanm 86:04dd9b1680ae 1488 #define ETH_MMC_IT_RGUF ((uint32_t)0x10020000) /*!< When Rx good unicast frames counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1489 #define ETH_MMC_IT_RFAE ((uint32_t)0x10000040) /*!< When Rx alignment error counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1490 #define ETH_MMC_IT_RFCE ((uint32_t)0x10000020) /*!< When Rx crc error counter reaches half the maximum value */
bogdanm 86:04dd9b1680ae 1491 /**
bogdanm 86:04dd9b1680ae 1492 * @}
bogdanm 86:04dd9b1680ae 1493 */
bogdanm 86:04dd9b1680ae 1494
Kojto 99:dbbf35b96557 1495 /** @defgroup ETH_MAC_Flags ETH MAC Flags
bogdanm 86:04dd9b1680ae 1496 * @{
bogdanm 86:04dd9b1680ae 1497 */
bogdanm 86:04dd9b1680ae 1498 #define ETH_MAC_FLAG_TST ((uint32_t)0x00000200) /*!< Time stamp trigger flag (on MAC) */
bogdanm 86:04dd9b1680ae 1499 #define ETH_MAC_FLAG_MMCT ((uint32_t)0x00000040) /*!< MMC transmit flag */
bogdanm 86:04dd9b1680ae 1500 #define ETH_MAC_FLAG_MMCR ((uint32_t)0x00000020) /*!< MMC receive flag */
bogdanm 86:04dd9b1680ae 1501 #define ETH_MAC_FLAG_MMC ((uint32_t)0x00000010) /*!< MMC flag (on MAC) */
bogdanm 86:04dd9b1680ae 1502 #define ETH_MAC_FLAG_PMT ((uint32_t)0x00000008) /*!< PMT flag (on MAC) */
bogdanm 86:04dd9b1680ae 1503 /**
bogdanm 86:04dd9b1680ae 1504 * @}
bogdanm 86:04dd9b1680ae 1505 */
bogdanm 86:04dd9b1680ae 1506
Kojto 99:dbbf35b96557 1507 /** @defgroup ETH_DMA_Flags ETH DMA Flags
bogdanm 86:04dd9b1680ae 1508 * @{
bogdanm 86:04dd9b1680ae 1509 */
bogdanm 86:04dd9b1680ae 1510 #define ETH_DMA_FLAG_TST ((uint32_t)0x20000000) /*!< Time-stamp trigger interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1511 #define ETH_DMA_FLAG_PMT ((uint32_t)0x10000000) /*!< PMT interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1512 #define ETH_DMA_FLAG_MMC ((uint32_t)0x08000000) /*!< MMC interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1513 #define ETH_DMA_FLAG_DATATRANSFERERROR ((uint32_t)0x00800000) /*!< Error bits 0-Rx DMA, 1-Tx DMA */
Kojto 99:dbbf35b96557 1514 #define ETH_DMA_FLAG_READWRITEERROR ((uint32_t)0x01000000) /*!< Error bits 0-write transfer, 1-read transfer */
bogdanm 86:04dd9b1680ae 1515 #define ETH_DMA_FLAG_ACCESSERROR ((uint32_t)0x02000000) /*!< Error bits 0-data buffer, 1-desc. access */
bogdanm 86:04dd9b1680ae 1516 #define ETH_DMA_FLAG_NIS ((uint32_t)0x00010000) /*!< Normal interrupt summary flag */
bogdanm 86:04dd9b1680ae 1517 #define ETH_DMA_FLAG_AIS ((uint32_t)0x00008000) /*!< Abnormal interrupt summary flag */
bogdanm 86:04dd9b1680ae 1518 #define ETH_DMA_FLAG_ER ((uint32_t)0x00004000) /*!< Early receive flag */
bogdanm 86:04dd9b1680ae 1519 #define ETH_DMA_FLAG_FBE ((uint32_t)0x00002000) /*!< Fatal bus error flag */
bogdanm 86:04dd9b1680ae 1520 #define ETH_DMA_FLAG_ET ((uint32_t)0x00000400) /*!< Early transmit flag */
bogdanm 86:04dd9b1680ae 1521 #define ETH_DMA_FLAG_RWT ((uint32_t)0x00000200) /*!< Receive watchdog timeout flag */
bogdanm 86:04dd9b1680ae 1522 #define ETH_DMA_FLAG_RPS ((uint32_t)0x00000100) /*!< Receive process stopped flag */
bogdanm 86:04dd9b1680ae 1523 #define ETH_DMA_FLAG_RBU ((uint32_t)0x00000080) /*!< Receive buffer unavailable flag */
bogdanm 86:04dd9b1680ae 1524 #define ETH_DMA_FLAG_R ((uint32_t)0x00000040) /*!< Receive flag */
bogdanm 86:04dd9b1680ae 1525 #define ETH_DMA_FLAG_TU ((uint32_t)0x00000020) /*!< Underflow flag */
bogdanm 86:04dd9b1680ae 1526 #define ETH_DMA_FLAG_RO ((uint32_t)0x00000010) /*!< Overflow flag */
bogdanm 86:04dd9b1680ae 1527 #define ETH_DMA_FLAG_TJT ((uint32_t)0x00000008) /*!< Transmit jabber timeout flag */
bogdanm 86:04dd9b1680ae 1528 #define ETH_DMA_FLAG_TBU ((uint32_t)0x00000004) /*!< Transmit buffer unavailable flag */
bogdanm 86:04dd9b1680ae 1529 #define ETH_DMA_FLAG_TPS ((uint32_t)0x00000002) /*!< Transmit process stopped flag */
bogdanm 86:04dd9b1680ae 1530 #define ETH_DMA_FLAG_T ((uint32_t)0x00000001) /*!< Transmit flag */
bogdanm 86:04dd9b1680ae 1531 /**
bogdanm 86:04dd9b1680ae 1532 * @}
bogdanm 86:04dd9b1680ae 1533 */
bogdanm 86:04dd9b1680ae 1534
Kojto 99:dbbf35b96557 1535 /** @defgroup ETH_MAC_Interrupts ETH MAC Interrupts
bogdanm 86:04dd9b1680ae 1536 * @{
bogdanm 86:04dd9b1680ae 1537 */
bogdanm 86:04dd9b1680ae 1538 #define ETH_MAC_IT_TST ((uint32_t)0x00000200) /*!< Time stamp trigger interrupt (on MAC) */
bogdanm 86:04dd9b1680ae 1539 #define ETH_MAC_IT_MMCT ((uint32_t)0x00000040) /*!< MMC transmit interrupt */
bogdanm 86:04dd9b1680ae 1540 #define ETH_MAC_IT_MMCR ((uint32_t)0x00000020) /*!< MMC receive interrupt */
bogdanm 86:04dd9b1680ae 1541 #define ETH_MAC_IT_MMC ((uint32_t)0x00000010) /*!< MMC interrupt (on MAC) */
bogdanm 86:04dd9b1680ae 1542 #define ETH_MAC_IT_PMT ((uint32_t)0x00000008) /*!< PMT interrupt (on MAC) */
bogdanm 86:04dd9b1680ae 1543 /**
bogdanm 86:04dd9b1680ae 1544 * @}
bogdanm 86:04dd9b1680ae 1545 */
bogdanm 86:04dd9b1680ae 1546
Kojto 99:dbbf35b96557 1547 /** @defgroup ETH_DMA_Interrupts ETH DMA Interrupts
bogdanm 86:04dd9b1680ae 1548 * @{
bogdanm 86:04dd9b1680ae 1549 */
bogdanm 86:04dd9b1680ae 1550 #define ETH_DMA_IT_TST ((uint32_t)0x20000000) /*!< Time-stamp trigger interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1551 #define ETH_DMA_IT_PMT ((uint32_t)0x10000000) /*!< PMT interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1552 #define ETH_DMA_IT_MMC ((uint32_t)0x08000000) /*!< MMC interrupt (on DMA) */
bogdanm 86:04dd9b1680ae 1553 #define ETH_DMA_IT_NIS ((uint32_t)0x00010000) /*!< Normal interrupt summary */
bogdanm 86:04dd9b1680ae 1554 #define ETH_DMA_IT_AIS ((uint32_t)0x00008000) /*!< Abnormal interrupt summary */
bogdanm 86:04dd9b1680ae 1555 #define ETH_DMA_IT_ER ((uint32_t)0x00004000) /*!< Early receive interrupt */
bogdanm 86:04dd9b1680ae 1556 #define ETH_DMA_IT_FBE ((uint32_t)0x00002000) /*!< Fatal bus error interrupt */
bogdanm 86:04dd9b1680ae 1557 #define ETH_DMA_IT_ET ((uint32_t)0x00000400) /*!< Early transmit interrupt */
bogdanm 86:04dd9b1680ae 1558 #define ETH_DMA_IT_RWT ((uint32_t)0x00000200) /*!< Receive watchdog timeout interrupt */
bogdanm 86:04dd9b1680ae 1559 #define ETH_DMA_IT_RPS ((uint32_t)0x00000100) /*!< Receive process stopped interrupt */
bogdanm 86:04dd9b1680ae 1560 #define ETH_DMA_IT_RBU ((uint32_t)0x00000080) /*!< Receive buffer unavailable interrupt */
bogdanm 86:04dd9b1680ae 1561 #define ETH_DMA_IT_R ((uint32_t)0x00000040) /*!< Receive interrupt */
bogdanm 86:04dd9b1680ae 1562 #define ETH_DMA_IT_TU ((uint32_t)0x00000020) /*!< Underflow interrupt */
bogdanm 86:04dd9b1680ae 1563 #define ETH_DMA_IT_RO ((uint32_t)0x00000010) /*!< Overflow interrupt */
bogdanm 86:04dd9b1680ae 1564 #define ETH_DMA_IT_TJT ((uint32_t)0x00000008) /*!< Transmit jabber timeout interrupt */
bogdanm 86:04dd9b1680ae 1565 #define ETH_DMA_IT_TBU ((uint32_t)0x00000004) /*!< Transmit buffer unavailable interrupt */
bogdanm 86:04dd9b1680ae 1566 #define ETH_DMA_IT_TPS ((uint32_t)0x00000002) /*!< Transmit process stopped interrupt */
bogdanm 86:04dd9b1680ae 1567 #define ETH_DMA_IT_T ((uint32_t)0x00000001) /*!< Transmit interrupt */
bogdanm 86:04dd9b1680ae 1568 /**
bogdanm 86:04dd9b1680ae 1569 * @}
bogdanm 86:04dd9b1680ae 1570 */
bogdanm 86:04dd9b1680ae 1571
Kojto 99:dbbf35b96557 1572 /** @defgroup ETH_DMA_transmit_process_state ETH DMA transmit process state
bogdanm 86:04dd9b1680ae 1573 * @{
bogdanm 86:04dd9b1680ae 1574 */
bogdanm 86:04dd9b1680ae 1575 #define ETH_DMA_TRANSMITPROCESS_STOPPED ((uint32_t)0x00000000) /*!< Stopped - Reset or Stop Tx Command issued */
bogdanm 86:04dd9b1680ae 1576 #define ETH_DMA_TRANSMITPROCESS_FETCHING ((uint32_t)0x00100000) /*!< Running - fetching the Tx descriptor */
bogdanm 86:04dd9b1680ae 1577 #define ETH_DMA_TRANSMITPROCESS_WAITING ((uint32_t)0x00200000) /*!< Running - waiting for status */
bogdanm 86:04dd9b1680ae 1578 #define ETH_DMA_TRANSMITPROCESS_READING ((uint32_t)0x00300000) /*!< Running - reading the data from host memory */
bogdanm 86:04dd9b1680ae 1579 #define ETH_DMA_TRANSMITPROCESS_SUSPENDED ((uint32_t)0x00600000) /*!< Suspended - Tx Descriptor unavailable */
bogdanm 86:04dd9b1680ae 1580 #define ETH_DMA_TRANSMITPROCESS_CLOSING ((uint32_t)0x00700000) /*!< Running - closing Rx descriptor */
bogdanm 86:04dd9b1680ae 1581
bogdanm 86:04dd9b1680ae 1582 /**
bogdanm 86:04dd9b1680ae 1583 * @}
bogdanm 86:04dd9b1680ae 1584 */
bogdanm 86:04dd9b1680ae 1585
bogdanm 86:04dd9b1680ae 1586
Kojto 99:dbbf35b96557 1587 /** @defgroup ETH_DMA_receive_process_state ETH DMA receive process state
bogdanm 86:04dd9b1680ae 1588 * @{
bogdanm 86:04dd9b1680ae 1589 */
bogdanm 86:04dd9b1680ae 1590 #define ETH_DMA_RECEIVEPROCESS_STOPPED ((uint32_t)0x00000000) /*!< Stopped - Reset or Stop Rx Command issued */
bogdanm 86:04dd9b1680ae 1591 #define ETH_DMA_RECEIVEPROCESS_FETCHING ((uint32_t)0x00020000) /*!< Running - fetching the Rx descriptor */
bogdanm 86:04dd9b1680ae 1592 #define ETH_DMA_RECEIVEPROCESS_WAITING ((uint32_t)0x00060000) /*!< Running - waiting for packet */
bogdanm 86:04dd9b1680ae 1593 #define ETH_DMA_RECEIVEPROCESS_SUSPENDED ((uint32_t)0x00080000) /*!< Suspended - Rx Descriptor unavailable */
bogdanm 86:04dd9b1680ae 1594 #define ETH_DMA_RECEIVEPROCESS_CLOSING ((uint32_t)0x000A0000) /*!< Running - closing descriptor */
bogdanm 86:04dd9b1680ae 1595 #define ETH_DMA_RECEIVEPROCESS_QUEUING ((uint32_t)0x000E0000) /*!< Running - queuing the receive frame into host memory */
bogdanm 86:04dd9b1680ae 1596
bogdanm 86:04dd9b1680ae 1597 /**
bogdanm 86:04dd9b1680ae 1598 * @}
bogdanm 86:04dd9b1680ae 1599 */
bogdanm 86:04dd9b1680ae 1600
Kojto 99:dbbf35b96557 1601 /** @defgroup ETH_DMA_overflow ETH DMA overflow
bogdanm 86:04dd9b1680ae 1602 * @{
bogdanm 86:04dd9b1680ae 1603 */
bogdanm 86:04dd9b1680ae 1604 #define ETH_DMA_OVERFLOW_RXFIFOCOUNTER ((uint32_t)0x10000000) /*!< Overflow bit for FIFO overflow counter */
bogdanm 86:04dd9b1680ae 1605 #define ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER ((uint32_t)0x00010000) /*!< Overflow bit for missed frame counter */
bogdanm 86:04dd9b1680ae 1606 /**
bogdanm 86:04dd9b1680ae 1607 * @}
bogdanm 86:04dd9b1680ae 1608 */
bogdanm 86:04dd9b1680ae 1609
Kojto 99:dbbf35b96557 1610 /** @defgroup ETH_EXTI_LINE_WAKEUP ETH EXTI LINE WAKEUP
Kojto 99:dbbf35b96557 1611 * @{
Kojto 99:dbbf35b96557 1612 */
Kojto 99:dbbf35b96557 1613 #define ETH_EXTI_LINE_WAKEUP ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the ETH EXTI Line */
bogdanm 86:04dd9b1680ae 1614
Kojto 99:dbbf35b96557 1615 /**
Kojto 99:dbbf35b96557 1616 * @}
Kojto 99:dbbf35b96557 1617 */
bogdanm 86:04dd9b1680ae 1618
bogdanm 86:04dd9b1680ae 1619 /**
bogdanm 86:04dd9b1680ae 1620 * @}
bogdanm 86:04dd9b1680ae 1621 */
bogdanm 86:04dd9b1680ae 1622
bogdanm 86:04dd9b1680ae 1623 /* Exported macro ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 1624 /** @defgroup ETH_Exported_Macros ETH Exported Macros
Kojto 99:dbbf35b96557 1625 * @brief macros to handle interrupts and specific clock configurations
Kojto 99:dbbf35b96557 1626 * @{
Kojto 99:dbbf35b96557 1627 */
Kojto 99:dbbf35b96557 1628
bogdanm 86:04dd9b1680ae 1629 /** @brief Reset ETH handle state
bogdanm 86:04dd9b1680ae 1630 * @param __HANDLE__: specifies the ETH handle.
bogdanm 86:04dd9b1680ae 1631 * @retval None
bogdanm 86:04dd9b1680ae 1632 */
bogdanm 86:04dd9b1680ae 1633 #define __HAL_ETH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ETH_STATE_RESET)
bogdanm 86:04dd9b1680ae 1634
bogdanm 86:04dd9b1680ae 1635 /**
bogdanm 86:04dd9b1680ae 1636 * @brief Checks whether the specified ETHERNET DMA Tx Desc flag is set or not.
bogdanm 86:04dd9b1680ae 1637 * @param __HANDLE__: ETH Handle
Kojto 99:dbbf35b96557 1638 * @param __FLAG__: specifies the flag of TDES0 to check.
bogdanm 86:04dd9b1680ae 1639 * @retval the ETH_DMATxDescFlag (SET or RESET).
bogdanm 86:04dd9b1680ae 1640 */
bogdanm 86:04dd9b1680ae 1641 #define __HAL_ETH_DMATXDESC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->TxDesc->Status & (__FLAG__) == (__FLAG__))
bogdanm 86:04dd9b1680ae 1642
bogdanm 86:04dd9b1680ae 1643 /**
bogdanm 86:04dd9b1680ae 1644 * @brief Checks whether the specified ETHERNET DMA Rx Desc flag is set or not.
bogdanm 86:04dd9b1680ae 1645 * @param __HANDLE__: ETH Handle
Kojto 99:dbbf35b96557 1646 * @param __FLAG__: specifies the flag of RDES0 to check.
bogdanm 86:04dd9b1680ae 1647 * @retval the ETH_DMATxDescFlag (SET or RESET).
bogdanm 86:04dd9b1680ae 1648 */
bogdanm 86:04dd9b1680ae 1649 #define __HAL_ETH_DMARXDESC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->RxDesc->Status & (__FLAG__) == (__FLAG__))
bogdanm 86:04dd9b1680ae 1650
bogdanm 86:04dd9b1680ae 1651 /**
bogdanm 86:04dd9b1680ae 1652 * @brief Enables the specified DMA Rx Desc receive interrupt.
bogdanm 86:04dd9b1680ae 1653 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1654 * @retval None
bogdanm 86:04dd9b1680ae 1655 */
bogdanm 86:04dd9b1680ae 1656 #define __HAL_ETH_DMARXDESC_ENABLE_IT(__HANDLE__) ((__HANDLE__)->RxDesc->ControlBufferSize &=(~(uint32_t)ETH_DMARXDESC_DIC))
bogdanm 86:04dd9b1680ae 1657
bogdanm 86:04dd9b1680ae 1658 /**
bogdanm 86:04dd9b1680ae 1659 * @brief Disables the specified DMA Rx Desc receive interrupt.
bogdanm 86:04dd9b1680ae 1660 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1661 * @retval None
bogdanm 86:04dd9b1680ae 1662 */
bogdanm 86:04dd9b1680ae 1663 #define __HAL_ETH_DMARXDESC_DISABLE_IT(__HANDLE__) ((__HANDLE__)->RxDesc->ControlBufferSize |= ETH_DMARXDESC_DIC)
bogdanm 86:04dd9b1680ae 1664
bogdanm 86:04dd9b1680ae 1665 /**
bogdanm 86:04dd9b1680ae 1666 * @brief Set the specified DMA Rx Desc Own bit.
bogdanm 86:04dd9b1680ae 1667 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1668 * @retval None
bogdanm 86:04dd9b1680ae 1669 */
bogdanm 86:04dd9b1680ae 1670 #define __HAL_ETH_DMARXDESC_SET_OWN_BIT(__HANDLE__) ((__HANDLE__)->RxDesc->Status |= ETH_DMARXDESC_OWN)
bogdanm 86:04dd9b1680ae 1671
bogdanm 86:04dd9b1680ae 1672 /**
bogdanm 86:04dd9b1680ae 1673 * @brief Returns the specified ETHERNET DMA Tx Desc collision count.
bogdanm 86:04dd9b1680ae 1674 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1675 * @retval The Transmit descriptor collision counter value.
bogdanm 86:04dd9b1680ae 1676 */
bogdanm 86:04dd9b1680ae 1677 #define __HAL_ETH_DMATXDESC_GET_COLLISION_COUNT(__HANDLE__) (((__HANDLE__)->TxDesc->Status & ETH_DMATXDESC_CC) >> ETH_DMATXDESC_COLLISION_COUNTSHIFT)
bogdanm 86:04dd9b1680ae 1678
bogdanm 86:04dd9b1680ae 1679 /**
bogdanm 86:04dd9b1680ae 1680 * @brief Set the specified DMA Tx Desc Own bit.
bogdanm 86:04dd9b1680ae 1681 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1682 * @retval None
bogdanm 86:04dd9b1680ae 1683 */
bogdanm 86:04dd9b1680ae 1684 #define __HAL_ETH_DMATXDESC_SET_OWN_BIT(__HANDLE__) ((__HANDLE__)->TxDesc->Status |= ETH_DMATXDESC_OWN)
bogdanm 86:04dd9b1680ae 1685
bogdanm 86:04dd9b1680ae 1686 /**
bogdanm 86:04dd9b1680ae 1687 * @brief Enables the specified DMA Tx Desc Transmit interrupt.
bogdanm 86:04dd9b1680ae 1688 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1689 * @retval None
bogdanm 86:04dd9b1680ae 1690 */
bogdanm 86:04dd9b1680ae 1691 #define __HAL_ETH_DMATXDESC_ENABLE_IT(__HANDLE__) ((__HANDLE__)->TxDesc->Status |= ETH_DMATXDESC_IC)
bogdanm 86:04dd9b1680ae 1692
bogdanm 86:04dd9b1680ae 1693 /**
bogdanm 86:04dd9b1680ae 1694 * @brief Disables the specified DMA Tx Desc Transmit interrupt.
bogdanm 86:04dd9b1680ae 1695 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1696 * @retval None
bogdanm 86:04dd9b1680ae 1697 */
bogdanm 86:04dd9b1680ae 1698 #define __HAL_ETH_DMATXDESC_DISABLE_IT(__HANDLE__) ((__HANDLE__)->TxDesc->Status &= ~ETH_DMATXDESC_IC)
bogdanm 86:04dd9b1680ae 1699
bogdanm 86:04dd9b1680ae 1700 /**
bogdanm 86:04dd9b1680ae 1701 * @brief Selects the specified ETHERNET DMA Tx Desc Checksum Insertion.
bogdanm 86:04dd9b1680ae 1702 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1703 * @param __CHECKSUM__: specifies is the DMA Tx desc checksum insertion.
bogdanm 86:04dd9b1680ae 1704 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 1705 * @arg ETH_DMATXDESC_CHECKSUMBYPASS : Checksum bypass
bogdanm 86:04dd9b1680ae 1706 * @arg ETH_DMATXDESC_CHECKSUMIPV4HEADER : IPv4 header checksum
bogdanm 86:04dd9b1680ae 1707 * @arg ETH_DMATXDESC_CHECKSUMTCPUDPICMPSEGMENT : TCP/UDP/ICMP checksum. Pseudo header checksum is assumed to be present
bogdanm 86:04dd9b1680ae 1708 * @arg ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL : TCP/UDP/ICMP checksum fully in hardware including pseudo header
bogdanm 86:04dd9b1680ae 1709 * @retval None
bogdanm 86:04dd9b1680ae 1710 */
bogdanm 86:04dd9b1680ae 1711 #define __HAL_ETH_DMATXDESC_CHECKSUM_INSERTION(__HANDLE__, __CHECKSUM__) ((__HANDLE__)->TxDesc->Status |= (__CHECKSUM__))
bogdanm 86:04dd9b1680ae 1712
bogdanm 86:04dd9b1680ae 1713 /**
bogdanm 86:04dd9b1680ae 1714 * @brief Enables the DMA Tx Desc CRC.
bogdanm 86:04dd9b1680ae 1715 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1716 * @retval None
bogdanm 86:04dd9b1680ae 1717 */
bogdanm 86:04dd9b1680ae 1718 #define __HAL_ETH_DMATXDESC_CRC_ENABLE(__HANDLE__) ((__HANDLE__)->TxDesc->Status &= ~ETH_DMATXDESC_DC)
bogdanm 86:04dd9b1680ae 1719
bogdanm 86:04dd9b1680ae 1720 /**
bogdanm 86:04dd9b1680ae 1721 * @brief Disables the DMA Tx Desc CRC.
bogdanm 86:04dd9b1680ae 1722 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1723 * @retval None
bogdanm 86:04dd9b1680ae 1724 */
bogdanm 86:04dd9b1680ae 1725 #define __HAL_ETH_DMATXDESC_CRC_DISABLE(__HANDLE__) ((__HANDLE__)->TxDesc->Status |= ETH_DMATXDESC_DC)
bogdanm 86:04dd9b1680ae 1726
bogdanm 86:04dd9b1680ae 1727 /**
bogdanm 86:04dd9b1680ae 1728 * @brief Enables the DMA Tx Desc padding for frame shorter than 64 bytes.
bogdanm 86:04dd9b1680ae 1729 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1730 * @retval None
bogdanm 86:04dd9b1680ae 1731 */
bogdanm 86:04dd9b1680ae 1732 #define __HAL_ETH_DMATXDESC_SHORT_FRAME_PADDING_ENABLE(__HANDLE__) ((__HANDLE__)->TxDesc->Status &= ~ETH_DMATXDESC_DP)
bogdanm 86:04dd9b1680ae 1733
bogdanm 86:04dd9b1680ae 1734 /**
bogdanm 86:04dd9b1680ae 1735 * @brief Disables the DMA Tx Desc padding for frame shorter than 64 bytes.
bogdanm 86:04dd9b1680ae 1736 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1737 * @retval None
bogdanm 86:04dd9b1680ae 1738 */
bogdanm 86:04dd9b1680ae 1739 #define __HAL_ETH_DMATXDESC_SHORT_FRAME_PADDING_DISABLE(__HANDLE__) ((__HANDLE__)->TxDesc->Status |= ETH_DMATXDESC_DP)
bogdanm 86:04dd9b1680ae 1740
bogdanm 86:04dd9b1680ae 1741 /**
bogdanm 86:04dd9b1680ae 1742 * @brief Enables the specified ETHERNET MAC interrupts.
bogdanm 86:04dd9b1680ae 1743 * @param __HANDLE__ : ETH Handle
bogdanm 86:04dd9b1680ae 1744 * @param __INTERRUPT__: specifies the ETHERNET MAC interrupt sources to be
bogdanm 86:04dd9b1680ae 1745 * enabled or disabled.
bogdanm 86:04dd9b1680ae 1746 * This parameter can be any combination of the following values:
bogdanm 86:04dd9b1680ae 1747 * @arg ETH_MAC_IT_TST : Time stamp trigger interrupt
bogdanm 86:04dd9b1680ae 1748 * @arg ETH_MAC_IT_PMT : PMT interrupt
bogdanm 86:04dd9b1680ae 1749 * @retval None
bogdanm 86:04dd9b1680ae 1750 */
bogdanm 86:04dd9b1680ae 1751 #define __HAL_ETH_MAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MACIMR |= (__INTERRUPT__))
bogdanm 86:04dd9b1680ae 1752
bogdanm 86:04dd9b1680ae 1753 /**
bogdanm 86:04dd9b1680ae 1754 * @brief Disables the specified ETHERNET MAC interrupts.
bogdanm 86:04dd9b1680ae 1755 * @param __HANDLE__ : ETH Handle
bogdanm 86:04dd9b1680ae 1756 * @param __INTERRUPT__: specifies the ETHERNET MAC interrupt sources to be
bogdanm 86:04dd9b1680ae 1757 * enabled or disabled.
bogdanm 86:04dd9b1680ae 1758 * This parameter can be any combination of the following values:
bogdanm 86:04dd9b1680ae 1759 * @arg ETH_MAC_IT_TST : Time stamp trigger interrupt
bogdanm 86:04dd9b1680ae 1760 * @arg ETH_MAC_IT_PMT : PMT interrupt
bogdanm 86:04dd9b1680ae 1761 * @retval None
bogdanm 86:04dd9b1680ae 1762 */
bogdanm 86:04dd9b1680ae 1763 #define __HAL_ETH_MAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MACIMR &= ~(__INTERRUPT__))
bogdanm 86:04dd9b1680ae 1764
bogdanm 86:04dd9b1680ae 1765 /**
bogdanm 86:04dd9b1680ae 1766 * @brief Initiate a Pause Control Frame (Full-duplex only).
bogdanm 86:04dd9b1680ae 1767 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1768 * @retval None
bogdanm 86:04dd9b1680ae 1769 */
bogdanm 86:04dd9b1680ae 1770 #define __HAL_ETH_INITIATE_PAUSE_CONTROL_FRAME(__HANDLE__) ((__HANDLE__)->Instance->MACFCR |= ETH_MACFCR_FCBBPA)
bogdanm 86:04dd9b1680ae 1771
bogdanm 86:04dd9b1680ae 1772 /**
bogdanm 86:04dd9b1680ae 1773 * @brief Checks whether the ETHERNET flow control busy bit is set or not.
bogdanm 86:04dd9b1680ae 1774 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1775 * @retval The new state of flow control busy status bit (SET or RESET).
bogdanm 86:04dd9b1680ae 1776 */
bogdanm 86:04dd9b1680ae 1777 #define __HAL_ETH_GET_FLOW_CONTROL_BUSY_STATUS(__HANDLE__) (((__HANDLE__)->Instance->MACFCR & ETH_MACFCR_FCBBPA) == ETH_MACFCR_FCBBPA)
bogdanm 86:04dd9b1680ae 1778
bogdanm 86:04dd9b1680ae 1779 /**
bogdanm 86:04dd9b1680ae 1780 * @brief Enables the MAC Back Pressure operation activation (Half-duplex only).
bogdanm 86:04dd9b1680ae 1781 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1782 * @retval None
bogdanm 86:04dd9b1680ae 1783 */
bogdanm 86:04dd9b1680ae 1784 #define __HAL_ETH_BACK_PRESSURE_ACTIVATION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MACFCR |= ETH_MACFCR_FCBBPA)
bogdanm 86:04dd9b1680ae 1785
bogdanm 86:04dd9b1680ae 1786 /**
bogdanm 86:04dd9b1680ae 1787 * @brief Disables the MAC BackPressure operation activation (Half-duplex only).
bogdanm 86:04dd9b1680ae 1788 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1789 * @retval None
bogdanm 86:04dd9b1680ae 1790 */
bogdanm 86:04dd9b1680ae 1791 #define __HAL_ETH_BACK_PRESSURE_ACTIVATION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MACFCR &= ~ETH_MACFCR_FCBBPA)
bogdanm 86:04dd9b1680ae 1792
bogdanm 86:04dd9b1680ae 1793 /**
bogdanm 86:04dd9b1680ae 1794 * @brief Checks whether the specified ETHERNET MAC flag is set or not.
bogdanm 86:04dd9b1680ae 1795 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1796 * @param __FLAG__: specifies the flag to check.
bogdanm 86:04dd9b1680ae 1797 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 1798 * @arg ETH_MAC_FLAG_TST : Time stamp trigger flag
bogdanm 86:04dd9b1680ae 1799 * @arg ETH_MAC_FLAG_MMCT : MMC transmit flag
bogdanm 86:04dd9b1680ae 1800 * @arg ETH_MAC_FLAG_MMCR : MMC receive flag
bogdanm 86:04dd9b1680ae 1801 * @arg ETH_MAC_FLAG_MMC : MMC flag
bogdanm 86:04dd9b1680ae 1802 * @arg ETH_MAC_FLAG_PMT : PMT flag
bogdanm 86:04dd9b1680ae 1803 * @retval The state of ETHERNET MAC flag.
bogdanm 86:04dd9b1680ae 1804 */
bogdanm 86:04dd9b1680ae 1805 #define __HAL_ETH_MAC_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->MACSR &( __FLAG__)) == ( __FLAG__))
bogdanm 86:04dd9b1680ae 1806
bogdanm 86:04dd9b1680ae 1807 /**
bogdanm 86:04dd9b1680ae 1808 * @brief Enables the specified ETHERNET DMA interrupts.
bogdanm 86:04dd9b1680ae 1809 * @param __HANDLE__ : ETH Handle
bogdanm 86:04dd9b1680ae 1810 * @param __INTERRUPT__: specifies the ETHERNET DMA interrupt sources to be
Kojto 99:dbbf35b96557 1811 * enabled @ref ETH_DMA_Interrupts
bogdanm 86:04dd9b1680ae 1812 * @retval None
bogdanm 86:04dd9b1680ae 1813 */
bogdanm 86:04dd9b1680ae 1814 #define __HAL_ETH_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMAIER |= (__INTERRUPT__))
bogdanm 86:04dd9b1680ae 1815
bogdanm 86:04dd9b1680ae 1816 /**
bogdanm 86:04dd9b1680ae 1817 * @brief Disables the specified ETHERNET DMA interrupts.
bogdanm 86:04dd9b1680ae 1818 * @param __HANDLE__ : ETH Handle
bogdanm 86:04dd9b1680ae 1819 * @param __INTERRUPT__: specifies the ETHERNET DMA interrupt sources to be
Kojto 99:dbbf35b96557 1820 * disabled. @ref ETH_DMA_Interrupts
bogdanm 86:04dd9b1680ae 1821 * @retval None
bogdanm 86:04dd9b1680ae 1822 */
bogdanm 86:04dd9b1680ae 1823 #define __HAL_ETH_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMAIER &= ~(__INTERRUPT__))
bogdanm 86:04dd9b1680ae 1824
bogdanm 86:04dd9b1680ae 1825 /**
bogdanm 86:04dd9b1680ae 1826 * @brief Clears the ETHERNET DMA IT pending bit.
bogdanm 86:04dd9b1680ae 1827 * @param __HANDLE__ : ETH Handle
Kojto 99:dbbf35b96557 1828 * @param __INTERRUPT__: specifies the interrupt pending bit to clear. @ref ETH_DMA_Interrupts
bogdanm 86:04dd9b1680ae 1829 * @retval None
bogdanm 86:04dd9b1680ae 1830 */
bogdanm 86:04dd9b1680ae 1831 #define __HAL_ETH_DMA_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DMASR =(__INTERRUPT__))
bogdanm 86:04dd9b1680ae 1832
bogdanm 86:04dd9b1680ae 1833 /**
bogdanm 86:04dd9b1680ae 1834 * @brief Checks whether the specified ETHERNET DMA flag is set or not.
bogdanm 86:04dd9b1680ae 1835 * @param __HANDLE__: ETH Handle
Kojto 99:dbbf35b96557 1836 * @param __FLAG__: specifies the flag to check. @ref ETH_DMA_Flags
bogdanm 86:04dd9b1680ae 1837 * @retval The new state of ETH_DMA_FLAG (SET or RESET).
bogdanm 86:04dd9b1680ae 1838 */
bogdanm 86:04dd9b1680ae 1839 #define __HAL_ETH_DMA_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->DMASR &( __FLAG__)) == ( __FLAG__))
bogdanm 86:04dd9b1680ae 1840
bogdanm 86:04dd9b1680ae 1841 /**
bogdanm 86:04dd9b1680ae 1842 * @brief Checks whether the specified ETHERNET DMA flag is set or not.
bogdanm 86:04dd9b1680ae 1843 * @param __HANDLE__: ETH Handle
Kojto 99:dbbf35b96557 1844 * @param __FLAG__: specifies the flag to clear. @ref ETH_DMA_Flags
bogdanm 86:04dd9b1680ae 1845 * @retval The new state of ETH_DMA_FLAG (SET or RESET).
bogdanm 86:04dd9b1680ae 1846 */
bogdanm 86:04dd9b1680ae 1847 #define __HAL_ETH_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->DMASR = (__FLAG__))
bogdanm 86:04dd9b1680ae 1848
bogdanm 86:04dd9b1680ae 1849 /**
bogdanm 86:04dd9b1680ae 1850 * @brief Checks whether the specified ETHERNET DMA overflow flag is set or not.
bogdanm 86:04dd9b1680ae 1851 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1852 * @param __OVERFLOW__: specifies the DMA overflow flag to check.
bogdanm 86:04dd9b1680ae 1853 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 1854 * @arg ETH_DMA_OVERFLOW_RXFIFOCOUNTER : Overflow for FIFO Overflows Counter
bogdanm 86:04dd9b1680ae 1855 * @arg ETH_DMA_OVERFLOW_MISSEDFRAMECOUNTER : Overflow for Buffer Unavailable Missed Frame Counter
bogdanm 86:04dd9b1680ae 1856 * @retval The state of ETHERNET DMA overflow Flag (SET or RESET).
bogdanm 86:04dd9b1680ae 1857 */
bogdanm 86:04dd9b1680ae 1858 #define __HAL_ETH_GET_DMA_OVERFLOW_STATUS(__HANDLE__, __OVERFLOW__) (((__HANDLE__)->Instance->DMAMFBOCR & (__OVERFLOW__)) == (__OVERFLOW__))
bogdanm 86:04dd9b1680ae 1859
bogdanm 86:04dd9b1680ae 1860 /**
bogdanm 86:04dd9b1680ae 1861 * @brief Set the DMA Receive status watchdog timer register value
bogdanm 86:04dd9b1680ae 1862 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1863 * @param __VALUE__: DMA Receive status watchdog timer register value
bogdanm 86:04dd9b1680ae 1864 * @retval None
bogdanm 86:04dd9b1680ae 1865 */
bogdanm 86:04dd9b1680ae 1866 #define __HAL_ETH_SET_RECEIVE_WATCHDOG_TIMER(__HANDLE__, __VALUE__) ((__HANDLE__)->Instance->DMARSWTR = (__VALUE__))
bogdanm 86:04dd9b1680ae 1867
bogdanm 86:04dd9b1680ae 1868 /**
bogdanm 86:04dd9b1680ae 1869 * @brief Enables any unicast packet filtered by the MAC address
bogdanm 86:04dd9b1680ae 1870 * recognition to be a wake-up frame.
bogdanm 86:04dd9b1680ae 1871 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1872 * @retval None
bogdanm 86:04dd9b1680ae 1873 */
bogdanm 86:04dd9b1680ae 1874 #define __HAL_ETH_GLOBAL_UNICAST_WAKEUP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR |= ETH_MACPMTCSR_GU)
bogdanm 86:04dd9b1680ae 1875
bogdanm 86:04dd9b1680ae 1876 /**
bogdanm 86:04dd9b1680ae 1877 * @brief Disables any unicast packet filtered by the MAC address
bogdanm 86:04dd9b1680ae 1878 * recognition to be a wake-up frame.
bogdanm 86:04dd9b1680ae 1879 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1880 * @retval None
bogdanm 86:04dd9b1680ae 1881 */
bogdanm 86:04dd9b1680ae 1882 #define __HAL_ETH_GLOBAL_UNICAST_WAKEUP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR &= ~ETH_MACPMTCSR_GU)
bogdanm 86:04dd9b1680ae 1883
bogdanm 86:04dd9b1680ae 1884 /**
bogdanm 86:04dd9b1680ae 1885 * @brief Enables the MAC Wake-Up Frame Detection.
bogdanm 86:04dd9b1680ae 1886 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1887 * @retval None
bogdanm 86:04dd9b1680ae 1888 */
bogdanm 86:04dd9b1680ae 1889 #define __HAL_ETH_WAKEUP_FRAME_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR |= ETH_MACPMTCSR_WFE)
bogdanm 86:04dd9b1680ae 1890
bogdanm 86:04dd9b1680ae 1891 /**
bogdanm 86:04dd9b1680ae 1892 * @brief Disables the MAC Wake-Up Frame Detection.
bogdanm 86:04dd9b1680ae 1893 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1894 * @retval None
bogdanm 86:04dd9b1680ae 1895 */
bogdanm 86:04dd9b1680ae 1896 #define __HAL_ETH_WAKEUP_FRAME_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR &= ~ETH_MACPMTCSR_WFE)
bogdanm 86:04dd9b1680ae 1897
bogdanm 86:04dd9b1680ae 1898 /**
bogdanm 86:04dd9b1680ae 1899 * @brief Enables the MAC Magic Packet Detection.
bogdanm 86:04dd9b1680ae 1900 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1901 * @retval None
bogdanm 86:04dd9b1680ae 1902 */
bogdanm 86:04dd9b1680ae 1903 #define __HAL_ETH_MAGIC_PACKET_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR |= ETH_MACPMTCSR_MPE)
bogdanm 86:04dd9b1680ae 1904
bogdanm 86:04dd9b1680ae 1905 /**
bogdanm 86:04dd9b1680ae 1906 * @brief Disables the MAC Magic Packet Detection.
bogdanm 86:04dd9b1680ae 1907 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1908 * @retval None
bogdanm 86:04dd9b1680ae 1909 */
bogdanm 86:04dd9b1680ae 1910 #define __HAL_ETH_MAGIC_PACKET_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR &= ~ETH_MACPMTCSR_WFE)
bogdanm 86:04dd9b1680ae 1911
bogdanm 86:04dd9b1680ae 1912 /**
bogdanm 86:04dd9b1680ae 1913 * @brief Enables the MAC Power Down.
bogdanm 86:04dd9b1680ae 1914 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1915 * @retval None
bogdanm 86:04dd9b1680ae 1916 */
bogdanm 86:04dd9b1680ae 1917 #define __HAL_ETH_POWER_DOWN_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR |= ETH_MACPMTCSR_PD)
bogdanm 86:04dd9b1680ae 1918
bogdanm 86:04dd9b1680ae 1919 /**
bogdanm 86:04dd9b1680ae 1920 * @brief Disables the MAC Power Down.
bogdanm 86:04dd9b1680ae 1921 * @param __HANDLE__: ETH Handle
bogdanm 86:04dd9b1680ae 1922 * @retval None
bogdanm 86:04dd9b1680ae 1923 */
bogdanm 86:04dd9b1680ae 1924 #define __HAL_ETH_POWER_DOWN_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MACPMTCSR &= ~ETH_MACPMTCSR_PD)
bogdanm 86:04dd9b1680ae 1925
bogdanm 86:04dd9b1680ae 1926 /**
bogdanm 86:04dd9b1680ae 1927 * @brief Checks whether the specified ETHERNET PMT flag is set or not.
bogdanm 86:04dd9b1680ae 1928 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1929 * @param __FLAG__: specifies the flag to check.
bogdanm 86:04dd9b1680ae 1930 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 1931 * @arg ETH_PMT_FLAG_WUFFRPR : Wake-Up Frame Filter Register Pointer Reset
bogdanm 86:04dd9b1680ae 1932 * @arg ETH_PMT_FLAG_WUFR : Wake-Up Frame Received
bogdanm 86:04dd9b1680ae 1933 * @arg ETH_PMT_FLAG_MPR : Magic Packet Received
bogdanm 86:04dd9b1680ae 1934 * @retval The new state of ETHERNET PMT Flag (SET or RESET).
bogdanm 86:04dd9b1680ae 1935 */
bogdanm 86:04dd9b1680ae 1936 #define __HAL_ETH_GET_PMT_FLAG_STATUS(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->MACPMTCSR &( __FLAG__)) == ( __FLAG__))
bogdanm 86:04dd9b1680ae 1937
bogdanm 86:04dd9b1680ae 1938 /**
bogdanm 86:04dd9b1680ae 1939 * @brief Preset and Initialize the MMC counters to almost-full value: 0xFFFF_FFF0 (full - 16)
bogdanm 86:04dd9b1680ae 1940 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1941 * @retval None
bogdanm 86:04dd9b1680ae 1942 */
bogdanm 86:04dd9b1680ae 1943 #define __HAL_ETH_MMC_COUNTER_FULL_PRESET(__HANDLE__) ((__HANDLE__)->Instance->MMCCR |= (ETH_MMCCR_MCFHP | ETH_MMCCR_MCP))
bogdanm 86:04dd9b1680ae 1944
bogdanm 86:04dd9b1680ae 1945 /**
bogdanm 86:04dd9b1680ae 1946 * @brief Preset and Initialize the MMC counters to almost-half value: 0x7FFF_FFF0 (half - 16)
bogdanm 86:04dd9b1680ae 1947 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1948 * @retval None
bogdanm 86:04dd9b1680ae 1949 */
bogdanm 86:04dd9b1680ae 1950 #define __HAL_ETH_MMC_COUNTER_HALF_PRESET(__HANDLE__) do{(__HANDLE__)->Instance->MMCCR &= ~ETH_MMCCR_MCFHP;\
bogdanm 86:04dd9b1680ae 1951 (__HANDLE__)->Instance->MMCCR |= ETH_MMCCR_MCP;} while (0)
bogdanm 86:04dd9b1680ae 1952
bogdanm 86:04dd9b1680ae 1953 /**
bogdanm 86:04dd9b1680ae 1954 * @brief Enables the MMC Counter Freeze.
bogdanm 86:04dd9b1680ae 1955 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1956 * @retval None
bogdanm 86:04dd9b1680ae 1957 */
bogdanm 86:04dd9b1680ae 1958 #define __HAL_ETH_MMC_COUNTER_FREEZE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR |= ETH_MMCCR_MCF)
bogdanm 86:04dd9b1680ae 1959
bogdanm 86:04dd9b1680ae 1960 /**
bogdanm 86:04dd9b1680ae 1961 * @brief Disables the MMC Counter Freeze.
bogdanm 86:04dd9b1680ae 1962 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1963 * @retval None
bogdanm 86:04dd9b1680ae 1964 */
bogdanm 86:04dd9b1680ae 1965 #define __HAL_ETH_MMC_COUNTER_FREEZE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR &= ~ETH_MMCCR_MCF)
bogdanm 86:04dd9b1680ae 1966
bogdanm 86:04dd9b1680ae 1967 /**
bogdanm 86:04dd9b1680ae 1968 * @brief Enables the MMC Reset On Read.
bogdanm 86:04dd9b1680ae 1969 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1970 * @retval None
bogdanm 86:04dd9b1680ae 1971 */
bogdanm 86:04dd9b1680ae 1972 #define __HAL_ETH_ETH_MMC_RESET_ONREAD_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR |= ETH_MMCCR_ROR)
bogdanm 86:04dd9b1680ae 1973
bogdanm 86:04dd9b1680ae 1974 /**
bogdanm 86:04dd9b1680ae 1975 * @brief Disables the MMC Reset On Read.
bogdanm 86:04dd9b1680ae 1976 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1977 * @retval None
bogdanm 86:04dd9b1680ae 1978 */
bogdanm 86:04dd9b1680ae 1979 #define __HAL_ETH_ETH_MMC_RESET_ONREAD_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR &= ~ETH_MMCCR_ROR)
bogdanm 86:04dd9b1680ae 1980
bogdanm 86:04dd9b1680ae 1981 /**
bogdanm 86:04dd9b1680ae 1982 * @brief Enables the MMC Counter Stop Rollover.
bogdanm 86:04dd9b1680ae 1983 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1984 * @retval None
bogdanm 86:04dd9b1680ae 1985 */
bogdanm 86:04dd9b1680ae 1986 #define __HAL_ETH_ETH_MMC_COUNTER_ROLLOVER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR &= ~ETH_MMCCR_CSR)
bogdanm 86:04dd9b1680ae 1987
bogdanm 86:04dd9b1680ae 1988 /**
bogdanm 86:04dd9b1680ae 1989 * @brief Disables the MMC Counter Stop Rollover.
bogdanm 86:04dd9b1680ae 1990 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1991 * @retval None
bogdanm 86:04dd9b1680ae 1992 */
bogdanm 86:04dd9b1680ae 1993 #define __HAL_ETH_ETH_MMC_COUNTER_ROLLOVER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->MMCCR |= ETH_MMCCR_CSR)
bogdanm 86:04dd9b1680ae 1994
bogdanm 86:04dd9b1680ae 1995 /**
bogdanm 86:04dd9b1680ae 1996 * @brief Resets the MMC Counters.
bogdanm 86:04dd9b1680ae 1997 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 1998 * @retval None
bogdanm 86:04dd9b1680ae 1999 */
bogdanm 86:04dd9b1680ae 2000 #define __HAL_ETH_MMC_COUNTERS_RESET(__HANDLE__) ((__HANDLE__)->Instance->MMCCR |= ETH_MMCCR_CR)
bogdanm 86:04dd9b1680ae 2001
bogdanm 86:04dd9b1680ae 2002 /**
bogdanm 86:04dd9b1680ae 2003 * @brief Enables the specified ETHERNET MMC Rx interrupts.
bogdanm 86:04dd9b1680ae 2004 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 2005 * @param __INTERRUPT__: specifies the ETHERNET MMC interrupt sources to be enabled or disabled.
bogdanm 86:04dd9b1680ae 2006 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 2007 * @arg ETH_MMC_IT_RGUF : When Rx good unicast frames counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2008 * @arg ETH_MMC_IT_RFAE : When Rx alignment error counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2009 * @arg ETH_MMC_IT_RFCE : When Rx crc error counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2010 * @retval None
bogdanm 86:04dd9b1680ae 2011 */
bogdanm 86:04dd9b1680ae 2012 #define __HAL_ETH_MMC_RX_IT_ENABLE(__HANDLE__, __INTERRUPT__) (__HANDLE__)->Instance->MMCRIMR &= ~((__INTERRUPT__) & 0xEFFFFFFF)
bogdanm 86:04dd9b1680ae 2013 /**
bogdanm 86:04dd9b1680ae 2014 * @brief Disables the specified ETHERNET MMC Rx interrupts.
bogdanm 86:04dd9b1680ae 2015 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 2016 * @param __INTERRUPT__: specifies the ETHERNET MMC interrupt sources to be enabled or disabled.
bogdanm 86:04dd9b1680ae 2017 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 2018 * @arg ETH_MMC_IT_RGUF : When Rx good unicast frames counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2019 * @arg ETH_MMC_IT_RFAE : When Rx alignment error counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2020 * @arg ETH_MMC_IT_RFCE : When Rx crc error counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2021 * @retval None
bogdanm 86:04dd9b1680ae 2022 */
bogdanm 86:04dd9b1680ae 2023 #define __HAL_ETH_MMC_RX_IT_DISABLE(__HANDLE__, __INTERRUPT__) (__HANDLE__)->Instance->MMCRIMR |= ((__INTERRUPT__) & 0xEFFFFFFF)
bogdanm 86:04dd9b1680ae 2024 /**
bogdanm 86:04dd9b1680ae 2025 * @brief Enables the specified ETHERNET MMC Tx interrupts.
bogdanm 86:04dd9b1680ae 2026 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 2027 * @param __INTERRUPT__: specifies the ETHERNET MMC interrupt sources to be enabled or disabled.
bogdanm 86:04dd9b1680ae 2028 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 2029 * @arg ETH_MMC_IT_TGF : When Tx good frame counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2030 * @arg ETH_MMC_IT_TGFMSC: When Tx good multi col counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2031 * @arg ETH_MMC_IT_TGFSC : When Tx good single col counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2032 * @retval None
bogdanm 86:04dd9b1680ae 2033 */
bogdanm 86:04dd9b1680ae 2034 #define __HAL_ETH_MMC_TX_IT_ENABLE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MMCRIMR &= ~ (__INTERRUPT__))
bogdanm 86:04dd9b1680ae 2035
bogdanm 86:04dd9b1680ae 2036 /**
bogdanm 86:04dd9b1680ae 2037 * @brief Disables the specified ETHERNET MMC Tx interrupts.
bogdanm 86:04dd9b1680ae 2038 * @param __HANDLE__: ETH Handle.
bogdanm 86:04dd9b1680ae 2039 * @param __INTERRUPT__: specifies the ETHERNET MMC interrupt sources to be enabled or disabled.
bogdanm 86:04dd9b1680ae 2040 * This parameter can be one of the following values:
bogdanm 86:04dd9b1680ae 2041 * @arg ETH_MMC_IT_TGF : When Tx good frame counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2042 * @arg ETH_MMC_IT_TGFMSC: When Tx good multi col counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2043 * @arg ETH_MMC_IT_TGFSC : When Tx good single col counter reaches half the maximum value
bogdanm 86:04dd9b1680ae 2044 * @retval None
bogdanm 86:04dd9b1680ae 2045 */
Kojto 99:dbbf35b96557 2046 #define __HAL_ETH_MMC_TX_IT_DISABLE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->MMCRIMR |= (__INTERRUPT__))
Kojto 99:dbbf35b96557 2047
Kojto 99:dbbf35b96557 2048 /**
Kojto 99:dbbf35b96557 2049 * @brief Enables the ETH External interrupt line.
Kojto 99:dbbf35b96557 2050 * @retval None
Kojto 99:dbbf35b96557 2051 */
Kojto 99:dbbf35b96557 2052 #define __HAL_ETH_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2053
Kojto 99:dbbf35b96557 2054 /**
Kojto 99:dbbf35b96557 2055 * @brief Disables the ETH External interrupt line.
Kojto 99:dbbf35b96557 2056 * @retval None
Kojto 99:dbbf35b96557 2057 */
Kojto 99:dbbf35b96557 2058 #define __HAL_ETH_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2059
Kojto 99:dbbf35b96557 2060 /**
Kojto 99:dbbf35b96557 2061 * @brief Enable event on ETH External event line.
Kojto 99:dbbf35b96557 2062 * @retval None.
Kojto 99:dbbf35b96557 2063 */
Kojto 99:dbbf35b96557 2064 #define __HAL_ETH_WAKEUP_EXTI_ENABLE_EVENT() EXTI->EMR |= (ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2065
Kojto 99:dbbf35b96557 2066 /**
Kojto 99:dbbf35b96557 2067 * @brief Disable event on ETH External event line
Kojto 99:dbbf35b96557 2068 * @retval None.
Kojto 99:dbbf35b96557 2069 */
Kojto 99:dbbf35b96557 2070 #define __HAL_ETH_WAKEUP_EXTI_DISABLE_EVENT() EXTI->EMR &= ~(ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2071
Kojto 99:dbbf35b96557 2072 /**
Kojto 99:dbbf35b96557 2073 * @brief Get flag of the ETH External interrupt line.
Kojto 99:dbbf35b96557 2074 * @retval None
Kojto 99:dbbf35b96557 2075 */
Kojto 99:dbbf35b96557 2076 #define __HAL_ETH_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2077
Kojto 99:dbbf35b96557 2078 /**
Kojto 99:dbbf35b96557 2079 * @brief Clear flag of the ETH External interrupt line.
Kojto 99:dbbf35b96557 2080 * @retval None
Kojto 99:dbbf35b96557 2081 */
Kojto 99:dbbf35b96557 2082 #define __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (ETH_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 2083
Kojto 99:dbbf35b96557 2084 /**
Kojto 99:dbbf35b96557 2085 * @brief Enables rising edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2086 * @retval None
Kojto 99:dbbf35b96557 2087 */
Kojto 99:dbbf35b96557 2088 #define __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER() EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP
Kojto 99:dbbf35b96557 2089
Kojto 99:dbbf35b96557 2090 /**
Kojto 99:dbbf35b96557 2091 * @brief Disables the rising edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2092 * @retval None
Kojto 99:dbbf35b96557 2093 */
Kojto 110:165afa46840b 2094 #define __HAL_ETH_WAKEUP_EXTI_DISABLE_RISING_EDGE_TRIGGER() EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2095
Kojto 99:dbbf35b96557 2096 /**
Kojto 99:dbbf35b96557 2097 * @brief Enables falling edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2098 * @retval None
Kojto 99:dbbf35b96557 2099 */
Kojto 99:dbbf35b96557 2100 #define __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR |= (ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2101
Kojto 99:dbbf35b96557 2102 /**
Kojto 99:dbbf35b96557 2103 * @brief Disables falling edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2104 * @retval None
Kojto 99:dbbf35b96557 2105 */
Kojto 99:dbbf35b96557 2106 #define __HAL_ETH_WAKEUP_EXTI_DISABLE_FALLING_EDGE_TRIGGER() EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2107
Kojto 99:dbbf35b96557 2108 /**
Kojto 99:dbbf35b96557 2109 * @brief Enables rising/falling edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2110 * @retval None
Kojto 99:dbbf35b96557 2111 */
Kojto 99:dbbf35b96557 2112 #define __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER() EXTI->RTSR |= ETH_EXTI_LINE_WAKEUP;\
Kojto 99:dbbf35b96557 2113 EXTI->FTSR |= ETH_EXTI_LINE_WAKEUP
Kojto 99:dbbf35b96557 2114
Kojto 99:dbbf35b96557 2115 /**
Kojto 99:dbbf35b96557 2116 * @brief Disables rising/falling edge trigger to the ETH External interrupt line.
Kojto 99:dbbf35b96557 2117 * @retval None
Kojto 99:dbbf35b96557 2118 */
Kojto 99:dbbf35b96557 2119 #define __HAL_ETH_WAKEUP_EXTI_DISABLE_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(ETH_EXTI_LINE_WAKEUP);\
Kojto 99:dbbf35b96557 2120 EXTI->FTSR &= ~(ETH_EXTI_LINE_WAKEUP)
Kojto 99:dbbf35b96557 2121
Kojto 99:dbbf35b96557 2122 /**
Kojto 99:dbbf35b96557 2123 * @brief Generate a Software interrupt on selected EXTI line.
Kojto 99:dbbf35b96557 2124 * @retval None.
Kojto 99:dbbf35b96557 2125 */
Kojto 99:dbbf35b96557 2126 #define __HAL_ETH_WAKEUP_EXTI_GENERATE_SWIT() EXTI->SWIER|= ETH_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 2127
bogdanm 86:04dd9b1680ae 2128 /**
bogdanm 86:04dd9b1680ae 2129 * @}
bogdanm 86:04dd9b1680ae 2130 */
bogdanm 86:04dd9b1680ae 2131 /* Exported functions --------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 2132
Kojto 99:dbbf35b96557 2133 /** @addtogroup ETH_Exported_Functions
Kojto 99:dbbf35b96557 2134 * @{
Kojto 99:dbbf35b96557 2135 */
Kojto 99:dbbf35b96557 2136
bogdanm 86:04dd9b1680ae 2137 /* Initialization and de-initialization functions ****************************/
Kojto 99:dbbf35b96557 2138
Kojto 99:dbbf35b96557 2139 /** @addtogroup ETH_Exported_Functions_Group1
Kojto 99:dbbf35b96557 2140 * @{
Kojto 99:dbbf35b96557 2141 */
bogdanm 86:04dd9b1680ae 2142 HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2143 HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2144 void HAL_ETH_MspInit(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2145 void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2146 HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount);
bogdanm 86:04dd9b1680ae 2147 HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
bogdanm 86:04dd9b1680ae 2148
Kojto 99:dbbf35b96557 2149 /**
Kojto 99:dbbf35b96557 2150 * @}
Kojto 99:dbbf35b96557 2151 */
bogdanm 86:04dd9b1680ae 2152 /* IO operation functions ****************************************************/
Kojto 99:dbbf35b96557 2153
Kojto 99:dbbf35b96557 2154 /** @addtogroup ETH_Exported_Functions_Group2
Kojto 99:dbbf35b96557 2155 * @{
Kojto 99:dbbf35b96557 2156 */
bogdanm 86:04dd9b1680ae 2157 HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameLength);
bogdanm 86:04dd9b1680ae 2158 HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth);
Kojto 99:dbbf35b96557 2159 /* Communication with PHY functions*/
Kojto 99:dbbf35b96557 2160 HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue);
Kojto 99:dbbf35b96557 2161 HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue);
Kojto 99:dbbf35b96557 2162 /* Non-Blocking mode: Interrupt */
bogdanm 86:04dd9b1680ae 2163 HAL_StatusTypeDef HAL_ETH_GetReceivedFrame_IT(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2164 void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth);
Kojto 99:dbbf35b96557 2165 /* Callback in non blocking modes (Interrupt) */
bogdanm 86:04dd9b1680ae 2166 void HAL_ETH_TxCpltCallback(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2167 void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2168 void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth);
Kojto 99:dbbf35b96557 2169 /**
Kojto 99:dbbf35b96557 2170 * @}
Kojto 99:dbbf35b96557 2171 */
bogdanm 86:04dd9b1680ae 2172
bogdanm 86:04dd9b1680ae 2173 /* Peripheral Control functions **********************************************/
Kojto 99:dbbf35b96557 2174
Kojto 99:dbbf35b96557 2175 /** @addtogroup ETH_Exported_Functions_Group3
Kojto 99:dbbf35b96557 2176 * @{
Kojto 99:dbbf35b96557 2177 */
Kojto 99:dbbf35b96557 2178
bogdanm 86:04dd9b1680ae 2179 HAL_StatusTypeDef HAL_ETH_Start(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2180 HAL_StatusTypeDef HAL_ETH_Stop(ETH_HandleTypeDef *heth);
bogdanm 86:04dd9b1680ae 2181 HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef *macconf);
bogdanm 86:04dd9b1680ae 2182 HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef *dmaconf);
bogdanm 86:04dd9b1680ae 2183 /**
bogdanm 86:04dd9b1680ae 2184 * @}
bogdanm 86:04dd9b1680ae 2185 */
bogdanm 86:04dd9b1680ae 2186
Kojto 99:dbbf35b96557 2187 /* Peripheral State functions ************************************************/
Kojto 99:dbbf35b96557 2188
Kojto 99:dbbf35b96557 2189 /** @addtogroup ETH_Exported_Functions_Group4
Kojto 99:dbbf35b96557 2190 * @{
Kojto 99:dbbf35b96557 2191 */
Kojto 99:dbbf35b96557 2192 HAL_ETH_StateTypeDef HAL_ETH_GetState(ETH_HandleTypeDef *heth);
Kojto 99:dbbf35b96557 2193 /**
Kojto 99:dbbf35b96557 2194 * @}
Kojto 99:dbbf35b96557 2195 */
Kojto 99:dbbf35b96557 2196
bogdanm 86:04dd9b1680ae 2197 /**
bogdanm 86:04dd9b1680ae 2198 * @}
Kojto 99:dbbf35b96557 2199 */
Kojto 99:dbbf35b96557 2200
Kojto 99:dbbf35b96557 2201 /**
Kojto 99:dbbf35b96557 2202 * @}
Kojto 99:dbbf35b96557 2203 */
Kojto 99:dbbf35b96557 2204
Kojto 99:dbbf35b96557 2205 /**
Kojto 99:dbbf35b96557 2206 * @}
Kojto 99:dbbf35b96557 2207 */
Kojto 99:dbbf35b96557 2208
Kojto 110:165afa46840b 2209 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx ||\
Kojto 110:165afa46840b 2210 STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
bogdanm 86:04dd9b1680ae 2211
bogdanm 86:04dd9b1680ae 2212 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 2213 }
bogdanm 86:04dd9b1680ae 2214 #endif
bogdanm 86:04dd9b1680ae 2215
bogdanm 86:04dd9b1680ae 2216 #endif /* __STM32F4xx_HAL_ETH_H */
bogdanm 86:04dd9b1680ae 2217
bogdanm 86:04dd9b1680ae 2218
bogdanm 86:04dd9b1680ae 2219 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/