mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
unify SPI helper APIs
This commit is contained in:
1 parent
b1c2ffe1a0
commit
d4212ab282
18 files changed
+75
-104
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user