Subversion Repositories LedShow

Rev

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

Rev 2 Rev 9
Line 4... Line 4...
4
  * @author  MCD Application Team
4
  * @author  MCD Application Team
5
  * @brief   Header file of ETH HAL module.
5
  * @brief   Header file of ETH HAL module.
6
  ******************************************************************************
6
  ******************************************************************************
7
  * @attention
7
  * @attention
8
  *
8
  *
9
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
9
  * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
-
 
10
  * All rights reserved.</center></h2>
10
  *
11
  *
11
  * Redistribution and use in source and binary forms, with or without modification,
12
  * This software component is licensed by ST under BSD 3-Clause license,
12
  * are permitted provided that the following conditions are met:
13
  * the "License"; You may not use this file except in compliance with the
13
  *   1. Redistributions of source code must retain the above copyright notice,
-
 
14
  *      this list of conditions and the following disclaimer.
-
 
15
  *   2. Redistributions in binary form must reproduce the above copyright notice,
-
 
16
  *      this list of conditions and the following disclaimer in the documentation
-
 
17
  *      and/or other materials provided with the distribution.
14
  * License. You may obtain a copy of the License at:
18
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-
 
19
  *      may be used to endorse or promote products derived from this software
15
  *                        opensource.org/licenses/BSD-3-Clause
20
  *      without specific prior written permission.
-
 
21
  *
-
 
22
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-
 
23
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-
 
24
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-
 
25
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-
 
26
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-
 
27
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-
 
28
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-
 
29
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-
 
30
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-
 
31
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
32
  *
16
  *
33
  ******************************************************************************
17
  ******************************************************************************
34
  */
18
  */
35
 
19
 
36
/* Define to prevent recursive inclusion -------------------------------------*/
20
/* Define to prevent recursive inclusion -------------------------------------*/
Line 42... Line 26...
42
#endif
26
#endif
43
 
27
 
44
/* Includes ------------------------------------------------------------------*/
28
/* Includes ------------------------------------------------------------------*/
45
#include "stm32f1xx_hal_def.h"
29
#include "stm32f1xx_hal_def.h"
46
 
30
 
-
 
31
#if defined (ETH)
-
 
32
 
47
/** @addtogroup STM32F1xx_HAL_Driver
33
/** @addtogroup STM32F1xx_HAL_Driver
48
  * @{
34
  * @{
49
  */
35
  */
50
#if defined (STM32F107xC)
-
 
51
 
36
 
52
/** @addtogroup ETH
37
/** @addtogroup ETH
53
  * @{
38
  * @{
54
  */
39
  */
55
 
40
 
Line 609... Line 594...
609
 
594
 
610
/**
595
/**
611
  * @brief  ETH Handle Structure definition
596
  * @brief  ETH Handle Structure definition
612
  */
597
  */
613
 
598
 
-
 
599
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
600
typedef struct __ETH_HandleTypeDef
-
 
601
#else
614
typedef struct
602
typedef struct
-
 
603
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
615
{
604
{
616
  ETH_TypeDef                *Instance;     /*!< Register base address       */
605
  ETH_TypeDef                *Instance;     /*!< Register base address       */
617
 
606
 
618
  ETH_InitTypeDef            Init;          /*!< Ethernet Init Configuration */
607
  ETH_InitTypeDef            Init;          /*!< Ethernet Init Configuration */
619
 
608
 
Line 627... Line 616...
627
 
616
 
628
  __IO HAL_ETH_StateTypeDef  State;         /*!< ETH communication state     */
617
  __IO HAL_ETH_StateTypeDef  State;         /*!< ETH communication state     */
629
 
618
 
630
  HAL_LockTypeDef            Lock;          /*!< ETH Lock                    */
619
  HAL_LockTypeDef            Lock;          /*!< ETH Lock                    */
631
 
620
 
-
 
621
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
622
 
-
 
623
  void (* TxCpltCallback)(struct __ETH_HandleTypeDef *heth);            /*!< ETH Tx Complete Callback   */
-
 
624
  void (* RxCpltCallback)(struct __ETH_HandleTypeDef *heth);            /*!< ETH Rx  Complete Callback   */
-
 
625
  void (* DMAErrorCallback)(struct __ETH_HandleTypeDef *heth);          /*!< DMA Error Callback      */
-
 
626
  void (* MspInitCallback)(struct __ETH_HandleTypeDef *heth);           /*!< ETH Msp Init callback       */
-
 
627
  void (* MspDeInitCallback)(struct __ETH_HandleTypeDef *heth);         /*!< ETH Msp DeInit callback     */
-
 
628
 
-
 
629
#endif  /* USE_HAL_ETH_REGISTER_CALLBACKS */
-
 
630
 
632
} ETH_HandleTypeDef;
631
} ETH_HandleTypeDef;
633
 
632
 
-
 
633
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
634
/**
-
 
635
  * @brief  HAL ETH Callback ID enumeration definition
-
 
636
  */
-
 
637
typedef enum
-
 
638
{
-
 
639
  HAL_ETH_MSPINIT_CB_ID            = 0x00U,    /*!< ETH MspInit callback ID            */
-
 
640
  HAL_ETH_MSPDEINIT_CB_ID          = 0x01U,    /*!< ETH MspDeInit callback ID          */
-
 
641
  HAL_ETH_TX_COMPLETE_CB_ID        = 0x02U,    /*!< ETH Tx Complete Callback ID        */
-
 
642
  HAL_ETH_RX_COMPLETE_CB_ID        = 0x03U,    /*!< ETH Rx Complete Callback ID        */
-
 
643
  HAL_ETH_DMA_ERROR_CB_ID          = 0x04U,    /*!< ETH DMA Error Callback ID          */
-
 
644
 
-
 
645
} HAL_ETH_CallbackIDTypeDef;
-
 
646
 
-
 
647
/**
-
 
648
  * @brief  HAL ETH Callback pointer definition
-
 
649
  */
-
 
650
typedef  void (*pETH_CallbackTypeDef)(ETH_HandleTypeDef *heth);  /*!< pointer to an ETH callback function */
-
 
651
 
-
 
652
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
-
 
653
 
634
/**
654
/**
635
 * @}
655
 * @}
636
 */
656
 */
637
 
657
 
638
/* Exported constants --------------------------------------------------------*/
658
/* Exported constants --------------------------------------------------------*/
Line 1520... Line 1540...
1520
 
1540
 
1521
/** @brief Reset ETH handle state
1541
/** @brief Reset ETH handle state
1522
  * @param  __HANDLE__: specifies the ETH handle.
1542
  * @param  __HANDLE__: specifies the ETH handle.
1523
  * @retval None
1543
  * @retval None
1524
  */
1544
  */
-
 
1545
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
1546
#define __HAL_ETH_RESET_HANDLE_STATE(__HANDLE__)  do{                                                 \
-
 
1547
                                                       (__HANDLE__)->State = HAL_ETH_STATE_RESET;     \
-
 
1548
                                                       (__HANDLE__)->MspInitCallback = NULL;          \
-
 
1549
                                                       (__HANDLE__)->MspDeInitCallback = NULL;        \
-
 
1550
                                                     } while(0)
-
 
1551
#else
1525
#define __HAL_ETH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ETH_STATE_RESET)
1552
#define __HAL_ETH_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_ETH_STATE_RESET)
-
 
1553
#endif /*USE_HAL_ETH_REGISTER_CALLBACKS */
1526
 
1554
 
1527
/**
1555
/**
1528
  * @brief  Checks whether the specified ETHERNET DMA Tx Desc flag is set or not.
1556
  * @brief  Checks whether the specified ETHERNET DMA Tx Desc flag is set or not.
1529
  * @param  __HANDLE__: ETH Handle
1557
  * @param  __HANDLE__: ETH Handle
1530
  * @param  __FLAG__: specifies the flag of TDES0 to check.
1558
  * @param  __FLAG__: specifies the flag of TDES0 to check.
Line 2037... Line 2065...
2037
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth);
2065
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth);
2038
void HAL_ETH_MspInit(ETH_HandleTypeDef *heth);
2066
void HAL_ETH_MspInit(ETH_HandleTypeDef *heth);
2039
void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth);
2067
void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth);
2040
HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t *TxBuff, uint32_t TxBuffCount);
2068
HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t *TxBuff, uint32_t TxBuffCount);
2041
HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
2069
HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
-
 
2070
/* Callbacks Register/UnRegister functions  ***********************************/
-
 
2071
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
-
 
2072
HAL_StatusTypeDef HAL_ETH_RegisterCallback(ETH_HandleTypeDef *heth, HAL_ETH_CallbackIDTypeDef CallbackID, pETH_CallbackTypeDef pCallback);
-
 
2073
HAL_StatusTypeDef HAL_ETH_UnRegisterCallback(ETH_HandleTypeDef *heth, HAL_ETH_CallbackIDTypeDef CallbackID);
-
 
2074
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
2042
 
2075
 
2043
/**
2076
/**
2044
  * @}
2077
  * @}
2045
  */
2078
  */
2046
/* IO operation functions  ****************************************************/
2079
/* IO operation functions  ****************************************************/
Line 2094... Line 2127...
2094
 
2127
 
2095
/**
2128
/**
2096
  * @}
2129
  * @}
2097
  */
2130
  */
2098
 
2131
 
2099
#endif /* STM32F107xC */
-
 
2100
/**
2132
/**
2101
  * @}
2133
  * @}
2102
  */
2134
  */
2103
 
2135
 
-
 
2136
#endif /* ETH */
-
 
2137
 
2104
#ifdef __cplusplus
2138
#ifdef __cplusplus
2105
}
2139
}
2106
#endif
2140
#endif
2107
 
2141
 
2108
#endif /* __STM32F1xx_HAL_ETH_H */
2142
#endif /* __STM32F1xx_HAL_ETH_H */