MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / EMACConfigGet

Function EMACConfigGet

bsp/tm4c129x/libraries/driverlib/emac.c:1062–1123  ·  view source on GitHub ↗

Returns the Ethernet MAC's current basic configuration parameters. \param ui32Base is the base address of the Ethernet controller. \param pui32Config points to storage that is written with Ethernet MAC configuration. \param pui32Mode points to storage that is written with Ethernet MAC mode information. \param pui32RxMaxFrameSize points to storage that is written with the maximum receive frame siz

Source from the content-addressed store, hash-verified

1060//
1061//*****************************************************************************
1062void
1063EMACConfigGet(uint32_t ui32Base, uint32_t *pui32Config, uint32_t *pui32Mode,
1064 uint32_t *pui32RxMaxFrameSize)
1065{
1066 uint32_t ui32Value;
1067
1068 //
1069 // Parameter sanity check.
1070 //
1071 ASSERT(pui32Mode);
1072 ASSERT(pui32Config);
1073 ASSERT(pui32RxMaxFrameSize);
1074
1075 //
1076 // Return the mode information from the operation mode register.
1077 //
1078 *pui32Mode = HWREG(ui32Base + EMAC_O_DMAOPMODE);
1079
1080 //
1081 // Return the current configuration flags from the EMAC_O_CFG register.
1082 //
1083 *pui32Config = (HWREG(ui32Base + EMAC_O_CFG) &
1084 (VALID_CONFIG_FLAGS | EMAC_CONFIG_TX_ENABLED |
1085 EMAC_CONFIG_RX_ENABLED));
1086
1087 //
1088 // Get the receive packet size watchdog value.
1089 //
1090 ui32Value = HWREG(ui32Base + EMAC_O_WDOGTO);
1091 if(ui32Value & EMAC_WDOGTO_PWE)
1092 {
1093 //
1094 // The watchdog is enables so the maximum packet length can be read
1095 // from the watchdog timeout register.
1096 //
1097 *pui32RxMaxFrameSize = ui32Value & EMAC_WDOGTO_WTO_M;
1098 }
1099 else
1100 {
1101 //
1102 // The maximum packet size override found in the watchdog timer
1103 // register is not enabled so the maximum packet size is determined
1104 // by whether or not jumbo frame mode is enabled.
1105 //
1106 if(HWREG(ui32Base + EMAC_O_CFG) & EMAC_CFG_JFEN)
1107 {
1108 //
1109 // Jumbo frames are enabled so the watchdog kicks in at 10240
1110 // bytes.
1111 //
1112 *pui32RxMaxFrameSize = 10240;
1113 }
1114 else
1115 {
1116 //
1117 // Jumbo frames are not enabled so the watchdog kicks in at
1118 // 2048 bytes.
1119 //

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected