@@ -2712,6 +2712,7 @@ bool mg_ota_flash_end(struct mg_flash *flash);
2712
2712
2713
2713
2714
2714
2715
+
2715
2716
struct mg_tcpip_if ; // Mongoose TCP/IP network interface
2716
2717
2717
2718
struct mg_tcpip_driver {
@@ -2778,7 +2779,6 @@ void mg_tcpip_arp_request(struct mg_tcpip_if *ifp, uint32_t ip, uint8_t *mac);
2778
2779
2779
2780
extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
2780
2781
extern struct mg_tcpip_driver mg_tcpip_driver_w5500;
2781
- extern struct mg_tcpip_driver mg_tcpip_driver_w5100;
2782
2782
extern struct mg_tcpip_driver mg_tcpip_driver_tm4c;
2783
2783
extern struct mg_tcpip_driver mg_tcpip_driver_tms570;
2784
2784
extern struct mg_tcpip_driver mg_tcpip_driver_stm32h;
@@ -3195,22 +3195,14 @@ struct mg_tcpip_driver_tms570_data {
3195
3195
3196
3196
3197
3197
3198
- #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC ) && MG_ENABLE_DRIVER_XMC
3198
+ #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_W5500 ) && MG_ENABLE_DRIVER_W5500
3199
3199
3200
- struct mg_tcpip_driver_xmc_data {
3201
- // 13.2.8.1 Station Management Functions
3202
- // MDC clock divider (). MDC clock is derived from ETH MAC clock
3203
- // It must not exceed 2.5MHz
3204
- // ETH Clock range DIVIDER mdc_cr VALUE
3205
- // --------------------------------------------
3206
- // -1 <-- tell driver to guess the value
3207
- // 60-100 MHz ETH Clock/42 0
3208
- // 100-150 MHz ETH Clock/62 1
3209
- // 20-35 MHz ETH Clock/16 2
3210
- // 35-60 MHz ETH Clock/26 3
3211
- // 150-250 MHz ETH Clock/102 4
3212
- // 250-300 MHz ETH Clock/124 5
3213
- // 110, 111 Reserved
3200
+ #endif
3201
+
3202
+
3203
+ #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC7) && MG_ENABLE_DRIVER_XMC7
3204
+
3205
+ struct mg_tcpip_driver_xmc7_data {
3214
3206
int mdc_cr; // Valid values: -1, 0, 1, 2, 3, 4, 5
3215
3207
uint8_t phy_addr;
3216
3208
};
@@ -3220,31 +3212,45 @@ struct mg_tcpip_driver_xmc_data {
3220
3212
#endif
3221
3213
3222
3214
#ifndef MG_DRIVER_MDC_CR
3223
- #define MG_DRIVER_MDC_CR 4
3215
+ #define MG_DRIVER_MDC_CR 3
3224
3216
#endif
3225
3217
3226
3218
#define MG_TCPIP_DRIVER_INIT (mgr ) \
3227
3219
do { \
3228
- static struct mg_tcpip_driver_xmc_data driver_data_; \
3220
+ static struct mg_tcpip_driver_xmc7_data driver_data_; \
3229
3221
static struct mg_tcpip_if mif_; \
3230
3222
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
3231
3223
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
3232
3224
mif_.ip = MG_TCPIP_IP; \
3233
3225
mif_.mask = MG_TCPIP_MASK; \
3234
3226
mif_.gw = MG_TCPIP_GW; \
3235
- mif_.driver = &mg_tcpip_driver_xmc ; \
3227
+ mif_.driver = &mg_tcpip_driver_xmc7 ; \
3236
3228
mif_.driver_data = &driver_data_; \
3237
3229
MG_SET_MAC_ADDRESS (mif_.mac ); \
3238
3230
mg_tcpip_init (mgr, &mif_); \
3239
- MG_INFO ((" Driver: xmc , MAC: %M" , mg_print_mac, mif_.mac )); \
3231
+ MG_INFO ((" Driver: xmc7 , MAC: %M" , mg_print_mac, mif_.mac )); \
3240
3232
} while (0 )
3241
3233
3242
3234
#endif
3243
3235
3244
3236
3245
- #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC7) && MG_ENABLE_DRIVER_XMC7
3246
3237
3247
- struct mg_tcpip_driver_xmc7_data {
3238
+ #if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_XMC) && MG_ENABLE_DRIVER_XMC
3239
+
3240
+ struct mg_tcpip_driver_xmc_data {
3241
+ // 13.2.8.1 Station Management Functions
3242
+ // MDC clock divider (). MDC clock is derived from ETH MAC clock
3243
+ // It must not exceed 2.5MHz
3244
+ // ETH Clock range DIVIDER mdc_cr VALUE
3245
+ // --------------------------------------------
3246
+ // -1 <-- tell driver to guess the value
3247
+ // 60-100 MHz ETH Clock/42 0
3248
+ // 100-150 MHz ETH Clock/62 1
3249
+ // 20-35 MHz ETH Clock/16 2
3250
+ // 35-60 MHz ETH Clock/26 3
3251
+ // 150-250 MHz ETH Clock/102 4
3252
+ // 250-300 MHz ETH Clock/124 5
3253
+ // 110, 111 Reserved
3248
3254
int mdc_cr; // Valid values: -1, 0, 1, 2, 3, 4, 5
3249
3255
uint8_t phy_addr;
3250
3256
};
@@ -3254,28 +3260,27 @@ struct mg_tcpip_driver_xmc7_data {
3254
3260
#endif
3255
3261
3256
3262
#ifndef MG_DRIVER_MDC_CR
3257
- #define MG_DRIVER_MDC_CR 3
3263
+ #define MG_DRIVER_MDC_CR 4
3258
3264
#endif
3259
3265
3260
3266
#define MG_TCPIP_DRIVER_INIT (mgr ) \
3261
3267
do { \
3262
- static struct mg_tcpip_driver_xmc7_data driver_data_; \
3268
+ static struct mg_tcpip_driver_xmc_data driver_data_; \
3263
3269
static struct mg_tcpip_if mif_; \
3264
3270
driver_data_.mdc_cr = MG_DRIVER_MDC_CR; \
3265
3271
driver_data_.phy_addr = MG_TCPIP_PHY_ADDR; \
3266
3272
mif_.ip = MG_TCPIP_IP; \
3267
3273
mif_.mask = MG_TCPIP_MASK; \
3268
3274
mif_.gw = MG_TCPIP_GW; \
3269
- mif_.driver = &mg_tcpip_driver_xmc7 ; \
3275
+ mif_.driver = &mg_tcpip_driver_xmc ; \
3270
3276
mif_.driver_data = &driver_data_; \
3271
3277
MG_SET_MAC_ADDRESS (mif_.mac ); \
3272
3278
mg_tcpip_init (mgr, &mif_); \
3273
- MG_INFO ((" Driver: xmc7 , MAC: %M" , mg_print_mac, mif_.mac )); \
3279
+ MG_INFO ((" Driver: xmc , MAC: %M" , mg_print_mac, mif_.mac )); \
3274
3280
} while (0 )
3275
3281
3276
3282
#endif
3277
3283
3278
-
3279
3284
#ifdef __cplusplus
3280
3285
}
3281
3286
#endif
0 commit comments