mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +00:00
Make w5500 driver like the rest
This commit is contained in:
1 parent
277741ca53
commit
93f2939655
17 files changed
+182
-130
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_W5500) && \
|
||||
MG_ENABLE_DRIVER_W5500
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_w5500;
|
||||
|
||||
// Initialises W5500 on mgr. The application defines
|
||||
// struct mg_tcpip_spi mg_spi. Example: tutorials/rp/w5500-evb-pico
|
||||
#define MG_TCPIP_DRIVER_W5500_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.driver = &mg_tcpip_driver_w5500; \
|
||||
mif_.driver_data = &mg_spi; \
|
||||
MG_SET_MAC_ADDRESS(mif_.mac); \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
MG_INFO(("Driver: w5500, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#ifndef MG_TCPIP_DRIVER_INIT
|
||||
#define MG_TCPIP_DRIVER_INIT(x) MG_TCPIP_DRIVER_W5500_INIT(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user