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