Go to the documentation of this file.
31 #ifndef _MSP432E4_ETH_DRIVER_H
32 #define _MSP432E4_ETH_DRIVER_H
38 #ifndef MSP432E4_ETH_TX_BUFFER_COUNT
39 #define MSP432E4_ETH_TX_BUFFER_COUNT 3
40 #elif (MSP432E4_ETH_TX_BUFFER_COUNT < 1)
41 #error MSP432E4_ETH_TX_BUFFER_COUNT parameter is not valid
45 #ifndef MSP432E4_ETH_TX_BUFFER_SIZE
46 #define MSP432E4_ETH_TX_BUFFER_SIZE 1536
47 #elif (MSP432E4_ETH_TX_BUFFER_SIZE != 1536)
48 #error MSP432E4_ETH_TX_BUFFER_SIZE parameter is not valid
52 #ifndef MSP432E4_ETH_RX_BUFFER_COUNT
53 #define MSP432E4_ETH_RX_BUFFER_COUNT 6
54 #elif (MSP432E4_ETH_RX_BUFFER_COUNT < 1)
55 #error MSP432E4_ETH_RX_BUFFER_COUNT parameter is not valid
59 #ifndef MSP432E4_ETH_RX_BUFFER_SIZE
60 #define MSP432E4_ETH_RX_BUFFER_SIZE 1536
61 #elif (MSP432E4_ETH_RX_BUFFER_SIZE != 1536)
62 #error MSP432E4_ETH_RX_BUFFER_SIZE parameter is not valid
66 #ifndef MSP432E4_ETH_IRQ_PRIORITY_GROUPING
67 #define MSP432E4_ETH_IRQ_PRIORITY_GROUPING 3
68 #elif (MSP432E4_ETH_IRQ_PRIORITY_GROUPING < 0)
69 #error MSP432E4_ETH_IRQ_PRIORITY_GROUPING parameter is not valid
73 #ifndef MSP432E4_ETH_IRQ_PRIORITY
74 #define MSP432E4_ETH_IRQ_PRIORITY 192
75 #elif (MSP432E4_ETH_IRQ_PRIORITY < 0)
76 #error MSP432E4_ETH_IRQ_PRIORITY parameter is not valid
81 #define EMAC0_CFG_R HWREG(EMAC0_BASE + EMAC_O_CFG)
82 #define EMAC0_FRAMEFLTR_R HWREG(EMAC0_BASE + EMAC_O_FRAMEFLTR)
83 #define EMAC0_HASHTBLH_R HWREG(EMAC0_BASE + EMAC_O_HASHTBLH)
84 #define EMAC0_HASHTBLL_R HWREG(EMAC0_BASE + EMAC_O_HASHTBLL)
85 #define EMAC0_MIIADDR_R HWREG(EMAC0_BASE + EMAC_O_MIIADDR)
86 #define EMAC0_MIIDATA_R HWREG(EMAC0_BASE + EMAC_O_MIIDATA)
87 #define EMAC0_FLOWCTL_R HWREG(EMAC0_BASE + EMAC_O_FLOWCTL)
88 #define EMAC0_VLANTG_R HWREG(EMAC0_BASE + EMAC_O_VLANTG)
89 #define EMAC0_STATUS_R HWREG(EMAC0_BASE + EMAC_O_STATUS)
90 #define EMAC0_RWUFF_R HWREG(EMAC0_BASE + EMAC_O_RWUFF)
91 #define EMAC0_PMTCTLSTAT_R HWREG(EMAC0_BASE + EMAC_O_PMTCTLSTAT)
92 #define EMAC0_LPICTLSTAT_R HWREG(EMAC0_BASE + EMAC_O_LPICTLSTAT)
93 #define EMAC0_LPITIMERCTL_R HWREG(EMAC0_BASE + EMAC_O_LPITIMERCTL)
94 #define EMAC0_RIS_R HWREG(EMAC0_BASE + EMAC_O_RIS)
95 #define EMAC0_IM_R HWREG(EMAC0_BASE + EMAC_O_IM)
96 #define EMAC0_ADDR0H_R HWREG(EMAC0_BASE + EMAC_O_ADDR0H)
97 #define EMAC0_ADDR0L_R HWREG(EMAC0_BASE + EMAC_O_ADDR0L)
98 #define EMAC0_ADDR1H_R HWREG(EMAC0_BASE + EMAC_O_ADDR1H)
99 #define EMAC0_ADDR1L_R HWREG(EMAC0_BASE + EMAC_O_ADDR1L)
100 #define EMAC0_ADDR2H_R HWREG(EMAC0_BASE + EMAC_O_ADDR2H)
101 #define EMAC0_ADDR2L_R HWREG(EMAC0_BASE + EMAC_O_ADDR2L)
102 #define EMAC0_ADDR3H_R HWREG(EMAC0_BASE + EMAC_O_ADDR3H)
103 #define EMAC0_ADDR3L_R HWREG(EMAC0_BASE + EMAC_O_ADDR3L)
104 #define EMAC0_WDOGTO_R HWREG(EMAC0_BASE + EMAC_O_WDOGTO)
105 #define EMAC0_MMCCTRL_R HWREG(EMAC0_BASE + EMAC_O_MMCCTRL)
106 #define EMAC0_MMCRXRIS_R HWREG(EMAC0_BASE + EMAC_O_MMCRXRIS)
107 #define EMAC0_MMCTXRIS_R HWREG(EMAC0_BASE + EMAC_O_MMCTXRIS)
108 #define EMAC0_MMCRXIM_R HWREG(EMAC0_BASE + EMAC_O_MMCRXIM)
109 #define EMAC0_MMCTXIM_R HWREG(EMAC0_BASE + EMAC_O_MMCTXIM)
110 #define EMAC0_TXCNTGB_R HWREG(EMAC0_BASE + EMAC_O_TXCNTGB)
111 #define EMAC0_TXCNTSCOL_R HWREG(EMAC0_BASE + EMAC_O_TXCNTSCOL)
112 #define EMAC0_TXCNTMCOL_R HWREG(EMAC0_BASE + EMAC_O_TXCNTMCOL)
113 #define EMAC0_TXOCTCNTG_R HWREG(EMAC0_BASE + EMAC_O_TXOCTCNTG)
114 #define EMAC0_RXCNTGB_R HWREG(EMAC0_BASE + EMAC_O_RXCNTGB)
115 #define EMAC0_RXCNTCRCERR_R HWREG(EMAC0_BASE + EMAC_O_RXCNTCRCERR)
116 #define EMAC0_RXCNTALGNERR_R HWREG(EMAC0_BASE + EMAC_O_RXCNTALGNERR)
117 #define EMAC0_RXCNTGUNI_R HWREG(EMAC0_BASE + EMAC_O_RXCNTGUNI)
118 #define EMAC0_VLNINCREP_R HWREG(EMAC0_BASE + EMAC_O_VLNINCREP)
119 #define EMAC0_VLANHASH_R HWREG(EMAC0_BASE + EMAC_O_VLANHASH)
120 #define EMAC0_TIMSTCTRL_R HWREG(EMAC0_BASE + EMAC_O_TIMSTCTRL)
121 #define EMAC0_SUBSECINC_R HWREG(EMAC0_BASE + EMAC_O_SUBSECINC)
122 #define EMAC0_TIMSEC_R HWREG(EMAC0_BASE + EMAC_O_TIMSEC)
123 #define EMAC0_TIMNANO_R HWREG(EMAC0_BASE + EMAC_O_TIMNANO)
124 #define EMAC0_TIMSECU_R HWREG(EMAC0_BASE + EMAC_O_TIMSECU)
125 #define EMAC0_TIMNANOU_R HWREG(EMAC0_BASE + EMAC_O_TIMNANOU)
126 #define EMAC0_TIMADD_R HWREG(EMAC0_BASE + EMAC_O_TIMADD)
127 #define EMAC0_TARGSEC_R HWREG(EMAC0_BASE + EMAC_O_TARGSEC)
128 #define EMAC0_TARGNANO_R HWREG(EMAC0_BASE + EMAC_O_TARGNANO)
129 #define EMAC0_HWORDSEC_R HWREG(EMAC0_BASE + EMAC_O_HWORDSEC)
130 #define EMAC0_TIMSTAT_R HWREG(EMAC0_BASE + EMAC_O_TIMSTAT)
131 #define EMAC0_PPSCTRL_R HWREG(EMAC0_BASE + EMAC_O_PPSCTRL)
132 #define EMAC0_PPS0INTVL_R HWREG(EMAC0_BASE + EMAC_O_PPS0INTVL)
133 #define EMAC0_PPS0WIDTH_R HWREG(EMAC0_BASE + EMAC_O_PPS0WIDTH)
134 #define EMAC0_DMABUSMOD_R HWREG(EMAC0_BASE + EMAC_O_DMABUSMOD)
135 #define EMAC0_TXPOLLD_R HWREG(EMAC0_BASE + EMAC_O_TXPOLLD)
136 #define EMAC0_RXPOLLD_R HWREG(EMAC0_BASE + EMAC_O_RXPOLLD)
137 #define EMAC0_RXDLADDR_R HWREG(EMAC0_BASE + EMAC_O_RXDLADDR)
138 #define EMAC0_TXDLADDR_R HWREG(EMAC0_BASE + EMAC_O_TXDLADDR)
139 #define EMAC0_DMARIS_R HWREG(EMAC0_BASE + EMAC_O_DMARIS)
140 #define EMAC0_DMAOPMODE_R HWREG(EMAC0_BASE + EMAC_O_DMAOPMODE)
141 #define EMAC0_DMAIM_R HWREG(EMAC0_BASE + EMAC_O_DMAIM)
142 #define EMAC0_MFBOC_R HWREG(EMAC0_BASE + EMAC_O_MFBOC)
143 #define EMAC0_RXINTWDT_R HWREG(EMAC0_BASE + EMAC_O_RXINTWDT)
144 #define EMAC0_HOSTXDESC_R HWREG(EMAC0_BASE + EMAC_O_HOSTXDESC)
145 #define EMAC0_HOSRXDESC_R HWREG(EMAC0_BASE + EMAC_O_HOSRXDESC)
146 #define EMAC0_HOSTXBA_R HWREG(EMAC0_BASE + EMAC_O_HOSTXBA)
147 #define EMAC0_HOSRXBA_R HWREG(EMAC0_BASE + EMAC_O_HOSRXBA)
148 #define EMAC0_PP_R HWREG(EMAC0_BASE + EMAC_O_PP)
149 #define EMAC0_PC_R HWREG(EMAC0_BASE + EMAC_O_PC)
150 #define EMAC0_CC_R HWREG(EMAC0_BASE + EMAC_O_CC)
151 #define EMAC0_EPHYRIS_R HWREG(EMAC0_BASE + EMAC_O_EPHYRIS)
152 #define EMAC0_EPHYIM_R HWREG(EMAC0_BASE + EMAC_O_EPHYIM)
153 #define EMAC0_EPHYMISC_R HWREG(EMAC0_BASE + EMAC_O_EPHYMISC)
157 #define EMAC_DMABUSMOD_RPBL_1 (1 << EMAC_DMABUSMOD_RPBL_S)
158 #define EMAC_DMABUSMOD_RPBL_2 (2 << EMAC_DMABUSMOD_RPBL_S)
159 #define EMAC_DMABUSMOD_RPBL_4 (4 << EMAC_DMABUSMOD_RPBL_S)
160 #define EMAC_DMABUSMOD_RPBL_8 (8 << EMAC_DMABUSMOD_RPBL_S)
161 #define EMAC_DMABUSMOD_RPBL_16 (16 << EMAC_DMABUSMOD_RPBL_S)
162 #define EMAC_DMABUSMOD_RPBL_32 (32 << EMAC_DMABUSMOD_RPBL_S)
164 #define EMAC_DMABUSMOD_PR_1_1 (0 << EMAC_DMABUSMOD_PR_S)
165 #define EMAC_DMABUSMOD_PR_2_1 (1 << EMAC_DMABUSMOD_PR_S)
166 #define EMAC_DMABUSMOD_PR_3_1 (2 << EMAC_DMABUSMOD_PR_S)
167 #define EMAC_DMABUSMOD_PR_4_1 (3 << EMAC_DMABUSMOD_PR_S)
169 #define EMAC_DMABUSMOD_PBL_1 (1 << EMAC_DMABUSMOD_PBL_S)
170 #define EMAC_DMABUSMOD_PBL_2 (2 << EMAC_DMABUSMOD_PBL_S)
171 #define EMAC_DMABUSMOD_PBL_4 (4 << EMAC_DMABUSMOD_PBL_S)
172 #define EMAC_DMABUSMOD_PBL_8 (8 << EMAC_DMABUSMOD_PBL_S)
173 #define EMAC_DMABUSMOD_PBL_16 (16 << EMAC_DMABUSMOD_PBL_S)
174 #define EMAC_DMABUSMOD_PBL_32 (32 << EMAC_DMABUSMOD_PBL_S)
177 #define EMAC_TDES0_OWN 0x80000000
178 #define EMAC_TDES0_IC 0x40000000
179 #define EMAC_TDES0_LS 0x20000000
180 #define EMAC_TDES0_FS 0x10000000
181 #define EMAC_TDES0_DC 0x08000000
182 #define EMAC_TDES0_DP 0x04000000
183 #define EMAC_TDES0_TTSE 0x02000000
184 #define EMAC_TDES0_CRCR 0x01000000
185 #define EMAC_TDES0_CIC 0x00C00000
186 #define EMAC_TDES0_TER 0x00200000
187 #define EMAC_TDES0_TCH 0x00100000
188 #define EMAC_TDES0_VLIC 0x000C0000
189 #define EMAC_TDES0_TTSS 0x00020000
190 #define EMAC_TDES0_IHE 0x00010000
191 #define EMAC_TDES0_ES 0x00008000
192 #define EMAC_TDES0_JT 0x00004000
193 #define EMAC_TDES0_FF 0x00002000
194 #define EMAC_TDES0_IPE 0x00001000
195 #define EMAC_TDES0_LCA 0x00000800
196 #define EMAC_TDES0_NC 0x00000400
197 #define EMAC_TDES0_LCO 0x00000200
198 #define EMAC_TDES0_EC 0x00000100
199 #define EMAC_TDES0_VF 0x00000080
200 #define EMAC_TDES0_CC 0x00000078
201 #define EMAC_TDES0_ED 0x00000004
202 #define EMAC_TDES0_UF 0x00000002
203 #define EMAC_TDES0_DB 0x00000001
204 #define EMAC_TDES1_SAIC 0xE0000000
205 #define EMAC_TDES1_TBS2 0x1FFF0000
206 #define EMAC_TDES1_TBS1 0x00001FFF
207 #define EMAC_TDES2_TBAP1 0xFFFFFFFF
208 #define EMAC_TDES3_TBAP2 0xFFFFFFFF
209 #define EMAC_TDES6_TTSL 0xFFFFFFFF
210 #define EMAC_TDES7_TTSH 0xFFFFFFFF
213 #define EMAC_RDES0_OWN 0x80000000
214 #define EMAC_RDES0_AFM 0x40000000
215 #define EMAC_RDES0_FL 0x3FFF0000
216 #define EMAC_RDES0_ES 0x00008000
217 #define EMAC_RDES0_DE 0x00004000
218 #define EMAC_RDES0_SAF 0x00002000
219 #define EMAC_RDES0_LE 0x00001000
220 #define EMAC_RDES0_OE 0x00000800
221 #define EMAC_RDES0_VLAN 0x00000400
222 #define EMAC_RDES0_FS 0x00000200
223 #define EMAC_RDES0_LS 0x00000100
224 #define EMAC_RDES0_TSA_GF 0x00000080
225 #define EMAC_RDES0_LCO 0x00000040
226 #define EMAC_RDES0_FT 0x00000020
227 #define EMAC_RDES0_RWT 0x00000010
228 #define EMAC_RDES0_RE 0x00000008
229 #define EMAC_RDES0_DBE 0x00000004
230 #define EMAC_RDES0_CE 0x00000002
231 #define EMAC_RDES0_ESA 0x00000001
232 #define EMAC_RDES1_DIC 0x80000000
233 #define EMAC_RDES1_RBS2 0x1FFF0000
234 #define EMAC_RDES1_RER 0x00008000
235 #define EMAC_RDES1_RCH 0x00004000
236 #define EMAC_RDES1_RBS1 0x00001FFF
237 #define EMAC_RDES2_RBAP1 0xFFFFFFFF
238 #define EMAC_RDES3_RBAP2 0xFFFFFFFF
239 #define EMAC_RDES4_TSD 0x00004000
240 #define EMAC_RDES4_PV 0x00002000
241 #define EMAC_RDES4_PFT 0x00001000
242 #define EMAC_RDES4_PMT 0x00000F00
243 #define EMAC_RDES4_IPV6PR 0x00000080
244 #define EMAC_RDES4_IPV4PR 0x00000040
245 #define EMAC_RDES4_IPCB 0x00000020
246 #define EMAC_RDES4_IPPE 0x00000010
247 #define EMAC_RDES4_IPHE 0x00000008
248 #define EMAC_RDES4_IPPT 0x00000007
249 #define EMAC_RDES6_RTSL 0xFFFFFFFF
250 #define EMAC_RDES7_RTSH 0xFFFFFFFF
252 #ifndef ti_sysbios_BIOS___VERS
253 #define msp432e4EthIrqHandler EMAC0_IRQHandler
Structure describing a buffer that spans multiple chunks.
uint16_t msp432e4EthReadPhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Read PHY register.
void msp432e4EthEnableIrq(NetInterface *interface)
Enable interrupts.
void msp432e4EthWritePhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Write PHY register.
#define msp432e4EthIrqHandler
error_t msp432e4EthUpdateMacConfig(NetInterface *interface)
Adjust MAC configuration parameters for proper operation.
void msp432e4EthDumpPhyReg(void)
Dump PHY registers for debugging purpose.
error_t msp432e4EthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
Enhanced TX DMA descriptor.
const NicDriver msp432e4EthDriver
MSP432E4 Ethernet MAC driver.
error_t msp432e4EthInit(NetInterface *interface)
MSP432E4 Ethernet MAC initialization.
void msp432e4EthTick(NetInterface *interface)
MSP432E4 Ethernet MAC timer handler.
error_t msp432e4EthReceivePacket(NetInterface *interface)
Receive a packet.
Enhanced RX DMA descriptor.
Network interface controller abstraction layer.
void msp432e4EthEventHandler(NetInterface *interface)
MSP432E4 Ethernet MAC event handler.
void msp432e4EthInitGpio(NetInterface *interface)
GPIO configuration.
error_t msp432e4EthUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
uint32_t msp432e4EthCalcCrc(const void *data, size_t length)
CRC calculation.
void msp432e4EthDisableIrq(NetInterface *interface)
Disable interrupts.
void msp432e4EthInitDmaDesc(NetInterface *interface)
Initialize DMA descriptor lists.