mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-16 12:12:59 +08:00
commit
387a602885
@ -74,11 +74,13 @@ int main(void) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_spi spi = {NULL, spi_begin, spi_end, spi_txn};
|
struct mg_tcpip_spi spi = {NULL, spi_begin, spi_end, spi_txn};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(id),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(id),
|
||||||
.driver = &mg_tcpip_driver_w5500,
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
|
.driver = &mg_tcpip_driver_w5500,
|
||||||
.driver_data = &spi};
|
.driver_data = &spi};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||||
|
@ -136,10 +136,12 @@ int main(void)
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -49,11 +49,13 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
ethernet_init();
|
ethernet_init();
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -43,10 +43,12 @@ int main(void) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -150,10 +150,12 @@ int main(void)
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -49,11 +49,13 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
ethernet_init();
|
ethernet_init();
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -44,10 +44,12 @@ int main(void) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -40,10 +40,12 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -32,10 +32,12 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -32,10 +32,12 @@ static void server(const void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -32,10 +32,12 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -43,10 +43,12 @@ int main(void) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32,
|
.driver = &mg_tcpip_driver_stm32,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -152,10 +152,12 @@ int main(void)
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32h_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32h_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32h,
|
.driver = &mg_tcpip_driver_stm32h,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -510,10 +510,12 @@ void server(void *argument)
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_stm32h_data driver_data = {.mdc_cr = 4};
|
struct mg_tcpip_driver_stm32h_data driver_data = {.mdc_cr = 4};
|
||||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_stm32h,
|
.driver = &mg_tcpip_driver_stm32h,
|
||||||
.driver_data = &driver_data};
|
.driver_data = &driver_data};
|
||||||
mg_tcpip_init(&mgr, &mif);
|
mg_tcpip_init(&mgr, &mif);
|
||||||
|
@ -68,12 +68,14 @@ int main(void) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr =
|
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr =
|
||||||
1}; // See driver_tm4c.h
|
1}; // See driver_tm4c.h
|
||||||
struct mg_tcpip_if mif = {
|
struct mg_tcpip_if mif = {
|
||||||
.mac = READ_PREFLASHED_MAC(),
|
.mac = READ_PREFLASHED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_tm4c,
|
.driver = &mg_tcpip_driver_tm4c,
|
||||||
.driver_data = &driver_data,
|
.driver_data = &driver_data,
|
||||||
};
|
};
|
||||||
|
@ -53,12 +53,14 @@ static void server(void *args) {
|
|||||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||||
|
|
||||||
// Initialise Mongoose network stack
|
// Initialise Mongoose network stack
|
||||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
|
||||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
|
||||||
ethernet_init();
|
ethernet_init();
|
||||||
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1};
|
struct mg_tcpip_driver_tm4c_data driver_data = {.mdc_cr = 1};
|
||||||
struct mg_tcpip_if mif = {
|
struct mg_tcpip_if mif = {
|
||||||
.mac = READ_PREFLASHED_MAC(),
|
.mac = READ_PREFLASHED_MAC(),
|
||||||
|
// Uncomment below for static configuration:
|
||||||
|
// .ip = mg_htonl(MG_U32(192, 168, 0, 223)),
|
||||||
|
// .mask = mg_htonl(MG_U32(255, 255, 255, 0)),
|
||||||
|
// .gw = mg_htonl(MG_U32(192, 168, 0, 1)),
|
||||||
.driver = &mg_tcpip_driver_tm4c,
|
.driver = &mg_tcpip_driver_tm4c,
|
||||||
.driver_data = &driver_data,
|
.driver_data = &driver_data,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user