Subversion Repositories LedShow

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 9
Line 62... Line 62...
62
      (#) Configure the Ethernet DMA after ETH peripheral initialization
62
      (#) Configure the Ethernet DMA after ETH peripheral initialization
63
          HAL_ETH_ConfigDMA(); all DMA parameters should be filled.
63
          HAL_ETH_ConfigDMA(); all DMA parameters should be filled.
64
 
64
 
65
      -@- The PTP protocol and the DMA descriptors ring mode are not supported
65
      -@- The PTP protocol and the DMA descriptors ring mode are not supported
66
          in this driver
66
          in this driver
-
 
67
*** Callback registration ***
-
 
68
  =============================================
-
 
69
 
-
 
70
  The compilation define  USE_HAL_ETH_REGISTER_CALLBACKS when set to 1
-
 
71
  allows the user to configure dynamically the driver callbacks.
-
 
72
  Use Function @ref HAL_ETH_RegisterCallback() to register an interrupt callback.
-
 
73
 
-
 
74
  Function @ref HAL_ETH_RegisterCallback() allows to register following callbacks:
-
 
75
    (+) TxCpltCallback   : Tx Complete Callback.
-
 
76
    (+) RxCpltCallback   : Rx Complete Callback.
-
 
77
    (+) DMAErrorCallback : DMA Error Callback.
-
 
78
    (+) MspInitCallback  : MspInit Callback.
-
 
79
    (+) MspDeInitCallback: MspDeInit Callback.
-
 
80
 
-
 
81
  This function takes as parameters the HAL peripheral handle, the Callback ID
-
 
82
  and a pointer to the user callback function.
-
 
83
 
-
 
84
  Use function @ref HAL_ETH_UnRegisterCallback() to reset a callback to the default
-
 
85
  weak function.
-
 
86
  @ref HAL_ETH_UnRegisterCallback takes as parameters the HAL peripheral handle,
-
 
87
  and the Callback ID.
-
 
88
  This function allows to reset following callbacks:
-
 
89
    (+) TxCpltCallback   : Tx Complete Callback.
-
 
90
    (+) RxCpltCallback   : Rx Complete Callback.
-
 
91
    (+) DMAErrorCallback : DMA Error Callback.
-
 
92
    (+) MspInitCallback  : MspInit Callback.
-
 
93
    (+) MspDeInitCallback: MspDeInit Callback.
-
 
94
 
-
 
95
  By default, after the HAL_ETH_Init and when the state is HAL_ETH_STATE_RESET
-
 
96
  all callbacks are set to the corresponding weak functions:
-
 
97
  examples @ref HAL_ETH_TxCpltCallback(), @ref HAL_ETH_RxCpltCallback().
-
 
98
  Exception done for MspInit and MspDeInit functions that are
-
 
99
  reset to the legacy weak function in the HAL_ETH_Init/ @ref HAL_ETH_DeInit only when
-
 
100
  these callbacks are null (not registered beforehand).
-
 
101
  if not, MspInit or MspDeInit are not null, the HAL_ETH_Init/ @ref HAL_ETH_DeInit
-
 
102
  keep and use the user MspInit/MspDeInit callbacks (registered beforehand)
-
 
103
 
-
 
104
  Callbacks can be registered/unregistered in HAL_ETH_STATE_READY state only.
-
 
105
  Exception done MspInit/MspDeInit that can be registered/unregistered
-
 
106
  in HAL_ETH_STATE_READY or HAL_ETH_STATE_RESET state,
-
 
107
  thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
-
 
108
  In that case first register the MspInit/MspDeInit user callbacks
-
 
109
  using @ref HAL_ETH_RegisterCallback() before calling @ref HAL_ETH_DeInit
-
 
110
  or HAL_ETH_Init function.
-
 
111
 
-
 
112
  When The compilation define USE_HAL_ETH_REGISTER_CALLBACKS is set to 0 or
-
 
113
  not defined, the callback registration feature is not available and all callbacks
-
 
114
  are set to the corresponding weak functions.
67
 
115
 
68
  @endverbatim
116
  @endverbatim
69
  ******************************************************************************
117
  ******************************************************************************
70
  * @attention
118
  * @attention
71
  *
119
  *
72
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
120
  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
73
  *
-
 
74
  * Redistribution and use in source and binary forms, with or without modification,
-
 
75
  * are permitted provided that the following conditions are met:
-
 
76
  *   1. Redistributions of source code must retain the above copyright notice,
-
 
77
  *      this list of conditions and the following disclaimer.
-
 
78
  *   2. Redistributions in binary form must reproduce the above copyright notice,
-
 
79
  *      this list of conditions and the following disclaimer in the documentation
-
 
80
  *      and/or other materials provided with the distribution.
-
 
81
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-
 
82
  *      may be used to endorse or promote products derived from this software
-
 
83
  *      without specific prior written permission.
121
  * All rights reserved.</center></h2>
84
  *
122
  *
85
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
123
  * This software component is licensed by ST under BSD 3-Clause license,
86
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-
 
87
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-
 
88
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-
 
89
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-
 
90
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
124
  * the "License"; You may not use this file except in compliance with the
91
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
125
  * License. You may obtain a copy of the License at:
92
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-
 
93
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-
 
94
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126
  *                        opensource.org/licenses/BSD-3-Clause
95
  *
127
  *
96
  ******************************************************************************
128
  ******************************************************************************
97
  */
129
  */
98
 
130
 
99
/* Includes ------------------------------------------------------------------*/
131
/* Includes ------------------------------------------------------------------*/
100
#include "stm32f1xx_hal.h"
132
#include "stm32f1xx_hal.h"
101
 
133
 
102
/** @addtogroup STM32F1xx_HAL_Driver
134
/** @addtogroup STM32F1xx_HAL_Driver
103
  * @{
135
  * @{
104
  */
136
  */
105
#if defined (STM32F107xC)
-
 
106
 
137
 
107
/** @defgroup ETH ETH
138
/** @defgroup ETH ETH
108
  * @brief ETH HAL module driver
139
  * @brief ETH HAL module driver
109
  * @{
140
  * @{
110
  */
141
  */
111
 
142
 
112
#ifdef HAL_ETH_MODULE_ENABLED
143
#ifdef HAL_ETH_MODULE_ENABLED
113
 
144
 
-
 
145
#if defined (ETH)
-
 
146
 
114
/* Private typedef -----------------------------------------------------------*/
147
/* Private typedef -----------------------------------------------------------*/
115
/* Private define ------------------------------------------------------------*/
148
/* Private define ------------------------------------------------------------*/
116
/** @defgroup ETH_Private_Constants ETH Private Constants
149
/** @defgroup ETH_Private_Constants ETH Private Constants
117
  * @{
150
  * @{
118
  */
151
  */
Line 139... Line 172...
139
static void ETH_DMATransmissionDisable(ETH_HandleTypeDef *heth);
172
static void ETH_DMATransmissionDisable(ETH_HandleTypeDef *heth);
140
static void ETH_DMAReceptionEnable(ETH_HandleTypeDef *heth);
173
static void ETH_DMAReceptionEnable(ETH_HandleTypeDef *heth);
141
static void ETH_DMAReceptionDisable(ETH_HandleTypeDef *heth);
174
static void ETH_DMAReceptionDisable(ETH_HandleTypeDef *heth);
142
static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth);
175
static void ETH_FlushTransmitFIFO(ETH_HandleTypeDef *heth);
143
static void ETH_Delay(uint32_t mdelay);
176
static void ETH_Delay(uint32_t mdelay);
-
 
177
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
178
static void ETH_InitCallbacksToDefault(ETH_HandleTypeDef *heth);
-
 
179
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
144
 
180
 
145
/**
181
/**
146
  * @}
182
  * @}
147
  */
183
  */
148
/* Private functions ---------------------------------------------------------*/
184
/* Private functions ---------------------------------------------------------*/
Line 194... Line 230...
194
 
230
 
195
  if (heth->State == HAL_ETH_STATE_RESET)
231
  if (heth->State == HAL_ETH_STATE_RESET)
196
  {
232
  {
197
    /* Allocate lock resource and initialize it */
233
    /* Allocate lock resource and initialize it */
198
    heth->Lock = HAL_UNLOCKED;
234
    heth->Lock = HAL_UNLOCKED;
-
 
235
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
236
    ETH_InitCallbacksToDefault(heth);
-
 
237
 
-
 
238
    if (heth->MspInitCallback == NULL)
-
 
239
    {
-
 
240
      /* Init the low level hardware : GPIO, CLOCK, NVIC. */
-
 
241
      heth->MspInitCallback = HAL_ETH_MspInit;
-
 
242
    }
-
 
243
    heth->MspInitCallback(heth);
-
 
244
 
-
 
245
#else
199
    /* Init the low level hardware : GPIO, CLOCK, NVIC. */
246
    /* Init the low level hardware : GPIO, CLOCK, NVIC. */
200
    HAL_ETH_MspInit(heth);
247
    HAL_ETH_MspInit(heth);
-
 
248
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
201
  }
249
  }
202
 
250
 
203
  /* Select MII or RMII Mode*/
251
  /* Select MII or RMII Mode*/
204
  AFIO->MAPR &= ~(AFIO_MAPR_MII_RMII_SEL);
252
  AFIO->MAPR &= ~(AFIO_MAPR_MII_RMII_SEL);
205
  AFIO->MAPR |= (uint32_t)heth->Init.MediaInterface;
253
  AFIO->MAPR |= (uint32_t)heth->Init.MediaInterface;
Line 437... Line 485...
437
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth)
485
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth)
438
{
486
{
439
  /* Set the ETH peripheral state to BUSY */
487
  /* Set the ETH peripheral state to BUSY */
440
  heth->State = HAL_ETH_STATE_BUSY;
488
  heth->State = HAL_ETH_STATE_BUSY;
441
 
489
 
-
 
490
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
491
  if (heth->MspDeInitCallback == NULL)
-
 
492
  {
-
 
493
    heth->MspDeInitCallback = HAL_ETH_MspDeInit;
-
 
494
  }
-
 
495
  /* De-Init the low level hardware : GPIO, CLOCK, NVIC. */
-
 
496
  heth->MspDeInitCallback(heth);
-
 
497
#else
442
  /* De-Init the low level hardware : GPIO, CLOCK, NVIC. */
498
  /* De-Init the low level hardware : GPIO, CLOCK, NVIC. */
443
  HAL_ETH_MspDeInit(heth);
499
  HAL_ETH_MspDeInit(heth);
-
 
500
#endif
444
 
501
 
445
  /* Set ETH HAL state to Disabled */
502
  /* Set ETH HAL state to Disabled */
446
  heth->State = HAL_ETH_STATE_RESET;
503
  heth->State = HAL_ETH_STATE_RESET;
447
 
504
 
448
  /* Release Lock */
505
  /* Release Lock */
Line 617... Line 674...
617
  /* NOTE : This function Should not be modified, when the callback is needed,
674
  /* NOTE : This function Should not be modified, when the callback is needed,
618
  the HAL_ETH_MspDeInit could be implemented in the user file
675
  the HAL_ETH_MspDeInit could be implemented in the user file
619
  */
676
  */
620
}
677
}
621
 
678
 
-
 
679
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
680
/**
-
 
681
  * @brief  Register a User ETH Callback
-
 
682
  *         To be used instead of the weak predefined callback
-
 
683
  * @param heth eth handle
-
 
684
  * @param CallbackID ID of the callback to be registered
-
 
685
  *        This parameter can be one of the following values:
-
 
686
  *          @arg @ref HAL_ETH_TX_COMPLETE_CB_ID Tx Complete Callback ID
-
 
687
  *          @arg @ref HAL_ETH_RX_COMPLETE_CB_ID Rx Complete Callback ID
-
 
688
  *          @arg @ref HAL_ETH_DMA_ERROR_CB_ID   DMA Error Callback ID
-
 
689
  *          @arg @ref HAL_ETH_MSPINIT_CB_ID     MspInit callback ID
-
 
690
  *          @arg @ref HAL_ETH_MSPDEINIT_CB_ID   MspDeInit callback ID
-
 
691
  * @param pCallback pointer to the Callback function
-
 
692
  * @retval status
-
 
693
  */
-
 
694
HAL_StatusTypeDef HAL_ETH_RegisterCallback(ETH_HandleTypeDef *heth, HAL_ETH_CallbackIDTypeDef CallbackID, pETH_CallbackTypeDef pCallback)
-
 
695
{
-
 
696
  HAL_StatusTypeDef status = HAL_OK;
-
 
697
 
-
 
698
  if (pCallback == NULL)
-
 
699
  {
-
 
700
    return HAL_ERROR;
-
 
701
  }
-
 
702
  /* Process locked */
-
 
703
  __HAL_LOCK(heth);
-
 
704
 
-
 
705
  if (heth->State == HAL_ETH_STATE_READY)
-
 
706
  {
-
 
707
    switch (CallbackID)
-
 
708
    {
-
 
709
      case HAL_ETH_TX_COMPLETE_CB_ID :
-
 
710
        heth->TxCpltCallback = pCallback;
-
 
711
        break;
-
 
712
 
-
 
713
      case HAL_ETH_RX_COMPLETE_CB_ID :
-
 
714
        heth->RxCpltCallback = pCallback;
-
 
715
        break;
-
 
716
 
-
 
717
      case HAL_ETH_DMA_ERROR_CB_ID :
-
 
718
        heth->DMAErrorCallback = pCallback;
-
 
719
        break;
-
 
720
 
-
 
721
      case HAL_ETH_MSPINIT_CB_ID :
-
 
722
        heth->MspInitCallback = pCallback;
-
 
723
        break;
-
 
724
 
-
 
725
      case HAL_ETH_MSPDEINIT_CB_ID :
-
 
726
        heth->MspDeInitCallback = pCallback;
-
 
727
        break;
-
 
728
 
-
 
729
      default :
-
 
730
        /* Return error status */
-
 
731
        status =  HAL_ERROR;
-
 
732
        break;
-
 
733
    }
-
 
734
  }
-
 
735
  else if (heth->State == HAL_ETH_STATE_RESET)
-
 
736
  {
-
 
737
    switch (CallbackID)
-
 
738
    {
-
 
739
      case HAL_ETH_MSPINIT_CB_ID :
-
 
740
        heth->MspInitCallback = pCallback;
-
 
741
        break;
-
 
742
 
-
 
743
      case HAL_ETH_MSPDEINIT_CB_ID :
-
 
744
        heth->MspDeInitCallback = pCallback;
-
 
745
        break;
-
 
746
 
-
 
747
      default :
-
 
748
        /* Return error status */
-
 
749
        status =  HAL_ERROR;
-
 
750
        break;
-
 
751
    }
-
 
752
  }
-
 
753
  else
-
 
754
  {
-
 
755
    /* Return error status */
-
 
756
    status =  HAL_ERROR;
-
 
757
  }
-
 
758
 
-
 
759
  /* Release Lock */
-
 
760
  __HAL_UNLOCK(heth);
-
 
761
 
-
 
762
  return status;
-
 
763
}
-
 
764
 
-
 
765
/**
-
 
766
  * @brief  Unregister an ETH Callback
-
 
767
  *         ETH callabck is redirected to the weak predefined callback
-
 
768
  * @param heth eth handle
-
 
769
  * @param CallbackID ID of the callback to be unregistered
-
 
770
  *        This parameter can be one of the following values:
-
 
771
  *          @arg @ref HAL_ETH_TX_COMPLETE_CB_ID Tx Complete Callback ID
-
 
772
  *          @arg @ref HAL_ETH_RX_COMPLETE_CB_ID Rx Complete Callback ID
-
 
773
  *          @arg @ref HAL_ETH_DMA_ERROR_CB_ID      DMA Error Callback ID
-
 
774
  *          @arg @ref HAL_ETH_MSPINIT_CB_ID     MspInit callback ID
-
 
775
  *          @arg @ref HAL_ETH_MSPDEINIT_CB_ID   MspDeInit callback ID
-
 
776
  * @retval status
-
 
777
  */
-
 
778
HAL_StatusTypeDef HAL_ETH_UnRegisterCallback(ETH_HandleTypeDef *heth, HAL_ETH_CallbackIDTypeDef CallbackID)
-
 
779
{
-
 
780
  HAL_StatusTypeDef status = HAL_OK;
-
 
781
 
-
 
782
  /* Process locked */
-
 
783
  __HAL_LOCK(heth);
-
 
784
 
-
 
785
  if (heth->State == HAL_ETH_STATE_READY)
-
 
786
  {
-
 
787
    switch (CallbackID)
-
 
788
    {
-
 
789
      case HAL_ETH_TX_COMPLETE_CB_ID :
-
 
790
        heth->TxCpltCallback = HAL_ETH_TxCpltCallback;
-
 
791
        break;
-
 
792
 
-
 
793
      case HAL_ETH_RX_COMPLETE_CB_ID :
-
 
794
        heth->RxCpltCallback = HAL_ETH_RxCpltCallback;
-
 
795
        break;
-
 
796
 
-
 
797
      case HAL_ETH_DMA_ERROR_CB_ID :
-
 
798
        heth->DMAErrorCallback = HAL_ETH_ErrorCallback;
-
 
799
        break;
-
 
800
 
-
 
801
      case HAL_ETH_MSPINIT_CB_ID :
-
 
802
        heth->MspInitCallback = HAL_ETH_MspInit;
-
 
803
        break;
-
 
804
 
-
 
805
      case HAL_ETH_MSPDEINIT_CB_ID :
-
 
806
        heth->MspDeInitCallback = HAL_ETH_MspDeInit;
-
 
807
        break;
-
 
808
 
-
 
809
      default :
-
 
810
        /* Return error status */
-
 
811
        status =  HAL_ERROR;
-
 
812
        break;
-
 
813
    }
-
 
814
  }
-
 
815
  else if (heth->State == HAL_ETH_STATE_RESET)
-
 
816
  {
-
 
817
    switch (CallbackID)
-
 
818
    {
-
 
819
      case HAL_ETH_MSPINIT_CB_ID :
-
 
820
        heth->MspInitCallback = HAL_ETH_MspInit;
-
 
821
        break;
-
 
822
 
-
 
823
      case HAL_ETH_MSPDEINIT_CB_ID :
-
 
824
        heth->MspDeInitCallback = HAL_ETH_MspDeInit;
-
 
825
        break;
-
 
826
 
-
 
827
      default :
-
 
828
        /* Return error status */
-
 
829
        status =  HAL_ERROR;
-
 
830
        break;
-
 
831
    }
-
 
832
  }
-
 
833
  else
-
 
834
  {
-
 
835
    /* Return error status */
-
 
836
    status =  HAL_ERROR;
-
 
837
  }
-
 
838
 
-
 
839
  /* Release Lock */
-
 
840
  __HAL_UNLOCK(heth);
-
 
841
 
-
 
842
  return status;
-
 
843
}
-
 
844
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
-
 
845
 
622
/**
846
/**
623
  * @}
847
  * @}
624
  */
848
  */
625
 
849
 
626
/** @defgroup ETH_Exported_Functions_Group2 IO operation functions
850
/** @defgroup ETH_Exported_Functions_Group2 IO operation functions
Line 934... Line 1158...
934
void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth)
1158
void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth)
935
{
1159
{
936
  /* Frame received */
1160
  /* Frame received */
937
  if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_R))
1161
  if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_R))
938
  {
1162
  {
-
 
1163
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
1164
    /*Call registered Receive complete callback*/
-
 
1165
    heth->RxCpltCallback(heth);
-
 
1166
#else
939
    /* Receive complete callback */
1167
    /* Receive complete callback */
940
    HAL_ETH_RxCpltCallback(heth);
1168
    HAL_ETH_RxCpltCallback(heth);
-
 
1169
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
941
 
1170
 
942
    /* Clear the Eth DMA Rx IT pending bits */
1171
    /* Clear the Eth DMA Rx IT pending bits */
943
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_R);
1172
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_R);
944
 
1173
 
945
    /* Set HAL State to Ready */
1174
    /* Set HAL State to Ready */
Line 950... Line 1179...
950
 
1179
 
951
  }
1180
  }
952
  /* Frame transmitted */
1181
  /* Frame transmitted */
953
  else if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_T))
1182
  else if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_T))
954
  {
1183
  {
-
 
1184
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
1185
    /*  Call resgistered Transfer complete callback*/
-
 
1186
    heth->TxCpltCallback(heth);
-
 
1187
#else
955
    /* Transfer complete callback */
1188
    /* Transfer complete callback */
956
    HAL_ETH_TxCpltCallback(heth);
1189
    HAL_ETH_TxCpltCallback(heth);
-
 
1190
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
957
 
1191
 
958
    /* Clear the Eth DMA Tx IT pending bits */
1192
    /* Clear the Eth DMA Tx IT pending bits */
959
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_T);
1193
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_T);
960
 
1194
 
961
    /* Set HAL State to Ready */
1195
    /* Set HAL State to Ready */
Line 969... Line 1203...
969
  __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_NIS);
1203
  __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_NIS);
970
 
1204
 
971
  /* ETH DMA Error */
1205
  /* ETH DMA Error */
972
  if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_AIS))
1206
  if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_AIS))
973
  {
1207
  {
-
 
1208
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
1209
    heth->DMAErrorCallback(heth);
-
 
1210
#else
974
    /* Ethernet Error callback */
1211
    /* Ethernet Error callback */
975
    HAL_ETH_ErrorCallback(heth);
1212
    HAL_ETH_ErrorCallback(heth);
-
 
1213
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
976
 
1214
 
977
    /* Clear the interrupt flags */
1215
    /* Clear the interrupt flags */
978
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_FLAG_AIS);
1216
    __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_FLAG_AIS);
979
 
1217
 
980
    /* Set HAL State to Ready */
1218
    /* Set HAL State to Ready */
Line 2024... Line 2262...
2024
    __NOP();
2262
    __NOP();
2025
  }
2263
  }
2026
  while (Delay --);
2264
  while (Delay --);
2027
}
2265
}
2028
 
2266
 
-
 
2267
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
2268
static void ETH_InitCallbacksToDefault(ETH_HandleTypeDef *heth)
-
 
2269
{
-
 
2270
  /* Init the ETH Callback settings */
-
 
2271
  heth->TxCpltCallback       = HAL_ETH_TxCpltCallback; /* Legacy weak TxCpltCallback   */
-
 
2272
  heth->RxCpltCallback       = HAL_ETH_RxCpltCallback; /* Legacy weak RxCpltCallback   */
-
 
2273
  heth->DMAErrorCallback     = HAL_ETH_ErrorCallback;  /* Legacy weak DMAErrorCallback */
-
 
2274
}
-
 
2275
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
-
 
2276
 
2029
/**
2277
/**
2030
  * @}
2278
  * @}
2031
  */
2279
  */
2032
 
2280
 
-
 
2281
#endif /* ETH */
-
 
2282
 
2033
#endif /* HAL_ETH_MODULE_ENABLED */
2283
#endif /* HAL_ETH_MODULE_ENABLED */
2034
/**
2284
/**
2035
  * @}
2285
  * @}
2036
  */
2286
  */
2037
 
2287
 
2038
#endif /* STM32F107xC */
-
 
2039
/**
2288
/**
2040
  * @}
2289
  * @}
2041
  */
2290
  */
2042
 
2291
 
2043
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
2292
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/