mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-18 19:31:02 +00:00
Introduce ST67W6 driver
This commit is contained in:
1 parent
abe19d2367
commit
3d094ec921
6 files changed
+1140
-2
No files matched your search
+38
@@ -3336,6 +3336,7 @@ extern struct mg_tcpip_driver mg_tcpip_driver_pico_w;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_rw612;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_cyw;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_nxp_wifi;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_st67w6;
|
||||
|
||||
// Drivers that require SPI, can use this SPI abstraction
|
||||
struct mg_tcpip_spi {
|
||||
@@ -3743,6 +3744,43 @@ bool mg_sdio_transfer(struct mg_tcpip_sdio *sdio, bool write, unsigned int f,
|
||||
#endif
|
||||
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_ST67W6) && \
|
||||
MG_ENABLE_DRIVER_ST67W6
|
||||
|
||||
struct mg_tcpip_spi_ {
|
||||
void *spi; // Opaque SPI bus descriptor
|
||||
void (*begin)(void *); // SPI begin: slave select low
|
||||
void (*end)(void *); // SPI end: slave select high
|
||||
void (*txn)(void *, uint8_t *, uint8_t *,
|
||||
size_t len); // SPI transaction: write-read len bytes
|
||||
};
|
||||
|
||||
struct mg_tcpip_driver_st67w6_data {
|
||||
struct mg_wifi_data wifi;
|
||||
void *spi;
|
||||
bool (*is_ready)(void); // return state of module RDY pin
|
||||
struct mg_queue send_queue; // decouple tx calls from module polls
|
||||
};
|
||||
|
||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_st67w6_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
MG_SET_WIFI_CONFIG(&driver_data_); \
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.driver = &mg_tcpip_driver_st67w6; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mif_.recv_queue.size = 8192; \
|
||||
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
|
||||
mg_tcpip_init(mgr, &mif_); \
|
||||
MG_INFO(("Driver: st67w6, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if MG_ENABLE_TCPIP && defined(MG_ENABLE_DRIVER_STM32F) && \
|
||||
MG_ENABLE_DRIVER_STM32F
|
||||
|
||||
|
||||
Reference in new issue
Block a user