SPI flash support, with xiao nrf52 and portenta-h7

This commit is contained in:
cpq committed 2026-12-03 11:56:57 +00:00
1 parent 57e30ab2e9
commit f02ea9859e
17 files changed
+442 -17

No files matched your search

@@ -24,11 +24,17 @@ bool mg_random(void *buf, size_t len) {
return true;
}
// The on-board 16 MB flash for littlefs, see MG_LFS_FLASH in
// mongoose_config.h. Mongoose's SPI flash API drives it over hal.h's SPI
static struct mg_spi s_spi = {NULL, hal_spi_begin, hal_spi_end, hal_spi_txn};
MG_SPI_FLASH(mg_flash_spi, &s_spi);
int main(void) {
hal_rng_init();
hal_gpio_output(LED);
hal_gpio_write(LED, true); // Off, the LEDs are active low
hal_usb_init();
hal_spi_init(); // On-board flash, see MG_SPI_FLASH() above
struct mg_mgr mgr;
mg_mgr_init(&mgr); // Also starts the USB driver, see mongoose_config.h