1 // Copyright 2019 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 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 #include <stdint.h> 21 22 typedef volatile struct emac_ext_dev_s { 23 union { 24 struct { 25 uint32_t div_num : 4; 26 uint32_t h_div_num : 4; 27 uint32_t dly_num : 2; 28 uint32_t reserved10 : 22; 29 }; 30 uint32_t val; 31 } ex_clkout_conf; 32 union { 33 struct { 34 uint32_t div_num_10m : 6; 35 uint32_t h_div_num_10m : 6; 36 uint32_t div_num_100m : 6; 37 uint32_t h_div_num_100m : 6; 38 uint32_t clk_sel : 1; 39 uint32_t reserved25 : 7; 40 }; 41 uint32_t val; 42 } ex_oscclk_conf; 43 union { 44 struct { 45 uint32_t ext_en : 1; 46 uint32_t int_en : 1; 47 uint32_t rx_125_clk_en : 1; 48 uint32_t mii_clk_tx_en : 1; 49 uint32_t mii_clk_rx_en : 1; 50 uint32_t clk_en : 1; 51 uint32_t reserved6 : 26; 52 }; 53 uint32_t val; 54 } ex_clk_ctrl; 55 union { 56 struct { 57 uint32_t int_revmii_rx_clk_sel : 1; 58 uint32_t ext_revmii_rx_clk_sel : 1; 59 uint32_t sbd_flowctrl : 1; 60 uint32_t core_phy_addr : 5; 61 uint32_t revmii_phy_addr : 5; 62 uint32_t phy_intf_sel : 3; 63 uint32_t ss_mode : 1; 64 uint32_t sbd_clk_gating_en : 1; 65 uint32_t pmt_ctrl_en : 1; 66 uint32_t scr_smi_dly_rx_sync : 1; 67 uint32_t tx_err_out_en : 1; 68 uint32_t reserved21 : 11; 69 }; 70 uint32_t val; 71 } ex_phyinf_conf; 72 union { 73 struct { 74 uint32_t ram_pd_en : 2; 75 uint32_t reserved2 : 30; 76 }; 77 uint32_t val; 78 } pd_sel; 79 uint32_t reserved_14; 80 uint32_t reserved_18; 81 uint32_t reserved_1c; 82 uint32_t reserved_20; 83 uint32_t reserved_24; 84 uint32_t reserved_28; 85 uint32_t reserved_2c; 86 uint32_t reserved_30; 87 uint32_t reserved_34; 88 uint32_t reserved_38; 89 uint32_t reserved_3c; 90 uint32_t reserved_40; 91 uint32_t reserved_44; 92 uint32_t reserved_48; 93 uint32_t reserved_4c; 94 uint32_t reserved_50; 95 uint32_t reserved_54; 96 uint32_t reserved_58; 97 uint32_t reserved_5c; 98 uint32_t reserved_60; 99 uint32_t reserved_64; 100 uint32_t reserved_68; 101 uint32_t reserved_6c; 102 uint32_t reserved_70; 103 uint32_t reserved_74; 104 uint32_t reserved_78; 105 uint32_t reserved_7c; 106 uint32_t reserved_80; 107 uint32_t reserved_84; 108 uint32_t reserved_88; 109 uint32_t reserved_8c; 110 uint32_t reserved_90; 111 uint32_t reserved_94; 112 uint32_t reserved_98; 113 uint32_t reserved_9c; 114 uint32_t reserved_a0; 115 uint32_t reserved_a4; 116 uint32_t reserved_a8; 117 uint32_t reserved_ac; 118 uint32_t reserved_b0; 119 uint32_t reserved_b4; 120 uint32_t reserved_b8; 121 uint32_t reserved_bc; 122 uint32_t reserved_c0; 123 uint32_t reserved_c4; 124 uint32_t reserved_c8; 125 uint32_t reserved_cc; 126 uint32_t reserved_d0; 127 uint32_t reserved_d4; 128 uint32_t reserved_d8; 129 uint32_t reserved_dc; 130 uint32_t reserved_e0; 131 uint32_t reserved_e4; 132 uint32_t reserved_e8; 133 uint32_t reserved_ec; 134 uint32_t reserved_f0; 135 uint32_t reserved_f4; 136 uint32_t reserved_f8; 137 uint32_t ex_date; 138 } emac_ext_dev_t; 139 140 extern emac_ext_dev_t EMAC_EXT; 141 142 #ifdef __cplusplus 143 } 144 #endif 145