mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 17:42:30 +08:00
RA6 driver init macro
This commit is contained in:
parent
ccd6bcd95f
commit
f46c5b7214
29
mongoose.h
29
mongoose.h
@ -3186,6 +3186,35 @@ struct mg_tcpip_driver_ra_data {
|
||||
uint8_t phy_addr; // PHY address
|
||||
};
|
||||
|
||||
#ifndef MG_DRIVER_CLK_FREQ
|
||||
#define MG_DRIVER_CLK_FREQ 100000000UL
|
||||
#endif
|
||||
|
||||
#ifndef MG_DRIVER_IRQ_NO
|
||||
#define MG_DRIVER_IRQ_NO 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_TCPIP_PHY_ADDR
|
||||
#define MG_TCPIP_PHY_ADDR 0
|
||||
#endif
|
||||
|
||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_ra_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
driver_data_.clock = MG_DRIVER_CLK_FREQ; \
|
||||
driver_data_.irqno = MG_DRIVER_IRQ_NO; \
|
||||
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_ra; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
MG_SET_MAC_ADDRESS(mif_.mac); \
|
||||
mg_tcpip_init(mgr, &mif_); \
|
||||
MG_INFO(("Driver: ra, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -9,4 +9,33 @@ struct mg_tcpip_driver_ra_data {
|
||||
uint8_t phy_addr; // PHY address
|
||||
};
|
||||
|
||||
#ifndef MG_DRIVER_CLK_FREQ
|
||||
#define MG_DRIVER_CLK_FREQ 100000000UL
|
||||
#endif
|
||||
|
||||
#ifndef MG_DRIVER_IRQ_NO
|
||||
#define MG_DRIVER_IRQ_NO 0
|
||||
#endif
|
||||
|
||||
#ifndef MG_TCPIP_PHY_ADDR
|
||||
#define MG_TCPIP_PHY_ADDR 0
|
||||
#endif
|
||||
|
||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_ra_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
driver_data_.clock = MG_DRIVER_CLK_FREQ; \
|
||||
driver_data_.irqno = MG_DRIVER_IRQ_NO; \
|
||||
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_ra; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
MG_SET_MAC_ADDRESS(mif_.mac); \
|
||||
mg_tcpip_init(mgr, &mif_); \
|
||||
MG_INFO(("Driver: ra, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user