Add driver init for IMXRT

This commit is contained in:
Sergey Lyubka 2024-04-09 12:07:33 +02:00
parent b3312f3761
commit 03c326a04e
2 changed files with 32 additions and 0 deletions

View File

@ -2754,6 +2754,22 @@ struct mg_tcpip_driver_imxrt_data {
#define MG_DRIVER_MDC_CR 24
#endif
#define MG_TCPIP_DRIVER_INIT(mgr) \
do { \
static struct mg_tcpip_driver_imxrt_data driver_data_; \
static struct mg_tcpip_if mif_; \
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
mif_.ip = MG_TCPIP_IP; \
mif_.mask = MG_TCPIP_MASK; \
mif_.gw = MG_TCPIP_GW; \
mif_.driver = &mg_tcpip_driver_imxrt; \
mif_.driver_data = &driver_data_; \
MG_SET_MAC_ADDRESS(mif_.mac); \
mg_tcpip_init(mgr, &mif_); \
MG_INFO(("Driver: imxrt, MAC: %M", mg_print_mac, mif_.mac)); \
} while (0)
#endif

View File

@ -27,4 +27,20 @@ struct mg_tcpip_driver_imxrt_data {
#define MG_DRIVER_MDC_CR 24
#endif
#define MG_TCPIP_DRIVER_INIT(mgr) \
do { \
static struct mg_tcpip_driver_imxrt_data driver_data_; \
static struct mg_tcpip_if mif_; \
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
mif_.ip = MG_TCPIP_IP; \
mif_.mask = MG_TCPIP_MASK; \
mif_.gw = MG_TCPIP_GW; \
mif_.driver = &mg_tcpip_driver_imxrt; \
mif_.driver_data = &driver_data_; \
MG_SET_MAC_ADDRESS(mif_.mac); \
mg_tcpip_init(mgr, &mif_); \
MG_INFO(("Driver: imxrt, MAC: %M", mg_print_mac, mif_.mac)); \
} while (0)
#endif