unify SPI helper APIs

This commit is contained in:
Sergio R. Caprile committed 2026-04-01 14:11:35 -03:00
1 parent b1c2ffe1a0
commit d4212ab282
18 files changed
+75 -104

No files matched your search

+2 -2
View File
@@ -1178,7 +1178,7 @@ static bool cyw_spi_write(unsigned int f, uint32_t addr, void *data,
uint16_t len) {
struct mg_tcpip_driver_cyw_data *d =
(struct mg_tcpip_driver_cyw_data *) s_ifp->driver_data;
struct mg_tcpip_spi_ *s = (struct mg_tcpip_spi_ *) d->bus;
struct mg_tcpip_spi *s = (struct mg_tcpip_spi *) d->bus;
uint32_t hdr = CYW_SPID_WR | CYW_SPID_INC | CYW_SPID_FUNC(f) |
CYW_SPID_ADDR(addr) | CYW_SPID_LEN(len); // gSPI header
// TODO(scaprile): check spin in between and timeout values, return false
@@ -1208,7 +1208,7 @@ static void cyw_spi_read(unsigned int f, uint32_t addr, void *data,
uint16_t len) {
struct mg_tcpip_driver_cyw_data *d =
(struct mg_tcpip_driver_cyw_data *) s_ifp->driver_data;
struct mg_tcpip_spi_ *s = (struct mg_tcpip_spi_ *) d->bus;
struct mg_tcpip_spi *s = (struct mg_tcpip_spi *) d->bus;
uint32_t padding =
f == CYW_SPID_FUNC_CHIP
? 4