void ethernet_callback(ENET_Type *base, enet_handle_t *handle, enet_event_t event, void *param) { switch (event) { case kENET_RxEvent: enet_mac_rx_isr(); break; case kENET_TxEvent: enet_mac_tx_isr(); break; default: break; } }
void ENET_Receive_IRQHandler(void) { enet_dev_if_t *enetIfPtr = (enet_dev_if_t *)&enetDevIf[BOARD_DEBUG_ENET_INSTANCE]; if (enet_hal_get_interrupt_status(((enet_dev_if_t *)enetIfPtr)->deviceNumber, kEnetRxFrameInterrupt)) enet_mac_rx_isr(enetIfHandle); if (enet_hal_get_interrupt_status(((enet_dev_if_t *)enetIfPtr)->deviceNumber, kEnetTxFrameInterrupt)) enet_mac_tx_isr(enetIfHandle); if (emac_timer_fired) { // TODO: this will have to be replaced with a proper "PHY task" that can detect changes in link status. if (k64f_phy_state.connected == STATE_UNKNOWN) { k64f_phy_state.connected = 1; netif_set_link_up(k64f_enetdata.netif); } emac_timer_fired = 0; sys_check_timeouts(); } }
void ENET_Receive_IRQHandler(void) { enet_mac_rx_isr(enetIfHandle); }