1 // Copyright 2021 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #pragma once
15 
16 /**
17  * @brief Ethernet frame CRC length
18  *
19  */
20 #define ETH_CRC_LEN (4)
21 
22 /**
23 * @brief Ethernet interface
24 *
25 */
26 typedef enum {
27     EMAC_DATA_INTERFACE_RMII,    /*!< Reduced Media Independent Interface */
28     EMAC_DATA_INTERFACE_MII,     /*!< Media Independent Interface */
29 } eth_data_interface_t;
30 
31 /**
32 * @brief Ethernet link status
33 *
34 */
35 typedef enum {
36     ETH_LINK_UP,  /*!< Ethernet link is up */
37     ETH_LINK_DOWN /*!< Ethernet link is down */
38 } eth_link_t;
39 
40 /**
41 * @brief Ethernet speed
42 *
43 */
44 typedef enum {
45     ETH_SPEED_10M,  /*!< Ethernet speed is 10Mbps */
46     ETH_SPEED_100M, /*!< Ethernet speed is 100Mbps */
47     ETH_SPEED_MAX   /*!< Max speed mode (for checking purpose) */
48 } eth_speed_t;
49 
50 /**
51 * @brief Ethernet duplex mode
52 *
53 */
54 typedef enum {
55     ETH_DUPLEX_HALF,    /*!< Ethernet is in half duplex */
56     ETH_DUPLEX_FULL,    /*!< Ethernet is in full duplex */
57 } eth_duplex_t;
58 
59 /**
60 * @brief Ethernet Checksum
61 */
62 typedef enum {
63     ETH_CHECKSUM_SW, /*!< Ethernet checksum calculate by software */
64     ETH_CHECKSUM_HW  /*!< Ethernet checksum calculate by hardware */
65 } eth_checksum_t;
66