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

Function Ft_Gmac_UseDefaultMacAddr

bsp/ft2004/libraries/bsp/ft_gmac/ft_gmac.c:92–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92void Ft_Gmac_UseDefaultMacAddr(Ft_Gmac_t *Gmac, u8 *MacAddr)
93{
94 u32 MacAddrLo;
95 u32 MacAddrHi;
96 FGmac_Config_t *pConfig;
97 Ft_assertNoneReturn(Gmac != NULL);
98 pConfig = &Gmac->Config;
99
100 MacAddrLo = Ft_in32(pConfig->BaseAddress + GMAC_MAC_ADDR0_LOWER16BIT_OFFSET);
101 MacAddrHi = Ft_in32(pConfig->BaseAddress + GMAC_MAC_ADDR0_UPPER16BIT_OFFSET);
102
103 MacAddr[0] = MacAddrLo & 0xFF;
104 MacAddr[1] = (MacAddrLo >> 8) & 0xFF;
105 MacAddr[2] = (MacAddrLo >> 16) & 0xFF;
106 MacAddr[3] = (MacAddrLo >> 24) & 0xFF;
107 MacAddr[4] = MacAddrHi & 0xFF;
108 MacAddr[5] = (MacAddrHi >> 8) & 0xFF;
109}

Callers 2

rt_ft2004_gmac_initFunction · 0.85
rt_hw_gmac_initFunction · 0.85

Calls 1

Ft_in32Function · 0.85

Tested by

no test coverage detected