Refactor W5500 driver, add arduino w5500 example

This commit is contained in:
cpq committed 2022-09-02 12:58:54 +01:00
1 parent f7f7319698
commit 567fccd7ee
8 files changed
+233 -112

No files matched your search

+3 -2
View File
@@ -1423,7 +1423,7 @@ void mg_rpc_list(struct mg_rpc_req *r);
struct mip_driver {
void (*init)(uint8_t *mac, void *data); // Initialise driver
bool (*init)(uint8_t *mac, void *data); // Initialise driver
size_t (*tx)(const void *, size_t, void *data); // Transmit frame
size_t (*rx)(void *buf, size_t len, void *data); // Receive frame (polling)
bool (*up)(void *data); // Up/down status
@@ -1440,13 +1440,14 @@ void mip_init(struct mg_mgr *, struct mip_cfg *, struct mip_driver *, void *);
extern struct mip_driver mip_driver_stm32;
extern struct mip_driver mip_driver_enc28j60;
extern struct mip_driver mip_driver_w5500;
// Drivers that require SPI, can use this SPI abstraction
struct mip_spi {
void *spi; // Opaque SPI bus descriptor
uint8_t (*txn)(void *, uint8_t); // SPI transaction: write 1 byte, read reply
void (*begin)(void *); // SPI begin: slave select low
void (*end)(void *); // SPI end: slave select high
uint8_t (*txn)(void *, uint8_t); // SPI transaction: write 1 byte, read reply
};
#ifdef __cplusplus