Rename mg_tcpip_spi to mg_spi and move it to flash.h

This commit is contained in:
cpq committed 2026-12-03 09:39:00 +00:00
1 parent 1d8c55c892
commit e7bfbf99fa
23 files changed
+104 -106

No files matched your search

@@ -66,7 +66,7 @@ static void hwspecific_spi_init(void) {
mg_delayms(50);
}
static const struct mg_tcpip_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
static const struct mg_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
#ifndef CYW43_RESOURCE_ATTRIBUTE
#define CYW43_RESOURCE_ATTRIBUTE
@@ -162,7 +162,7 @@ static void mif_fn(struct mg_tcpip_if *ifp, int ev, void *ev_data) {
static struct mg_tcpip_driver_cyw_data d = {
{WIFI_SSID, WIFI_PASS, "mongoose", "mongoose", 0, 0, 0, 0, 10, true}, (struct mg_tcpip_spi *)&spi, (struct mg_tcpip_driver_cyw_firmware *)&fw, false};
{WIFI_SSID, WIFI_PASS, "mongoose", "mongoose", 0, 0, 0, 0, 10, true}, (struct mg_spi *)&spi, (struct mg_tcpip_driver_cyw_firmware *)&fw, false};
int main(void) {
uart_init(UART_DEBUG, 115200); // Initialise debug printf
@@ -66,7 +66,7 @@ static void hwspecific_spi_init(void) {
mg_delayms(50);
}
static const struct mg_tcpip_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
static const struct mg_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
#ifndef CYW43_RESOURCE_ATTRIBUTE
#define CYW43_RESOURCE_ATTRIBUTE
@@ -162,7 +162,7 @@ static void mif_fn(struct mg_tcpip_if *ifp, int ev, void *ev_data) {
static struct mg_tcpip_driver_cyw_data d = {
{WIFI_SSID, WIFI_PASS, "mongoose", "mongoose", 0, 0, 0, 0, 10, true}, (struct mg_tcpip_spi *)&spi, (struct mg_tcpip_driver_cyw_firmware *)&fw, false};
{WIFI_SSID, WIFI_PASS, "mongoose", "mongoose", 0, 0, 0, 0, 10, true}, (struct mg_spi *)&spi, (struct mg_tcpip_driver_cyw_firmware *)&fw, false};
int main(void) {
uart_init(UART_DEBUG, 115200); // Initialise debug printf
@@ -22,7 +22,7 @@ static struct spi spi_pins = {
};
// SPI bus used by the W5500 driver, see MG_TCPIP_DRIVER_W5500_INIT
struct mg_tcpip_spi mg_spi = {
struct mg_spi mg_spi = {
.begin = (void (*)(void *)) spi_begin,
.end = (void (*)(void *)) spi_end,
.txn = (void (*)(void *, uint8_t *, uint8_t *, size_t)) spi_txn,
@@ -114,7 +114,7 @@ void hwspecific_spi_init(void) {
HAL_GPIO_WritePin(SPI_CHIP_EN_GPIO_Port, SPI_CHIP_EN_Pin, 1);
}
static const struct mg_tcpip_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
static const struct mg_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
void wifi_setconfig(void *data) {
struct mg_tcpip_driver_st67w6_data *d = (struct mg_tcpip_driver_st67w6_data *) data;
@@ -128,6 +128,6 @@ void wifi_setconfig(void *data) {
d->wifi.apsecurity = 0;
d->wifi.apchannel = 10;
d->wifi.apmode = ENABLE_WIFI_AP;
d->spi = (struct mg_tcpip_spi *) &spi;
d->spi = (struct mg_spi *) &spi;
d->is_ready = hwspecific_is_ready;
}
@@ -57,7 +57,7 @@ void hwspecific_spi_init(void) {
hal_gpio_write(SPI_CHIP_EN, 1);
}
static const struct mg_tcpip_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
static const struct mg_spi spi = {NULL, hwspecific_spi_begin, hwspecific_spi_end, hwspecific_spi_txn};
void wifi_setconfig(void *data) {
struct mg_tcpip_driver_st67w6_data *d = (struct mg_tcpip_driver_st67w6_data *) data;
@@ -71,6 +71,6 @@ void wifi_setconfig(void *data) {
d->wifi.apsecurity = 0;
d->wifi.apchannel = 10;
d->wifi.apmode = ENABLE_WIFI_AP;
d->spi = (struct mg_tcpip_spi *) &spi;
d->spi = (struct mg_spi *) &spi;
d->is_ready = hwspecific_is_ready;
}