|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io block-device backend over the micro-SD-in-SPI-mode driver. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_io_blockdev_sdspi_init (ra8_io_blockdev_t *bd) |
| Bind the micro-SD-over-SPI backend into a caller-owned handle. | |
ra8_io block-device backend over the micro-SD-in-SPI-mode driver.
This backend wraps the ra8_sdmmc_spi singleton driver so a micro-SD card on the SPI bus appears to the fabric as a plain 512-byte logical block device. Reads and writes forward straight to the driver's CMD17 / CMD25 paths; erase uses the driver's verified-zero CMD32/CMD33/CMD38 sequence, and the reported erase value is therefore k_ra8_io_erase_value_zero. Because the underlying driver keeps a single global instance, this backend is stateless: the bound ra8_io_blockdev_t carries a NULL context and the vtable dispatches to the one driver singleton.
The application must bring the card up with ra8_sdmmc_spi_init(transport) before binding or using this device; the bind helper only wires the vtable and does not touch the bus.
Definition in file ra8_io_blockdev_sdspi.h.
|
nodiscard |
Bind the micro-SD-over-SPI backend into a caller-owned handle.
Points bd at the SD-SPI vtable with a NULL context (the ra8_sdmmc_spi driver is a single global instance, so no per-device state is needed). No allocation and no bus traffic occur; the caller owns bd. The card itself must already be initialised with ra8_sdmmc_spi_init before any I/O call is made through the bound device.
| [out] | bd | Handle to bind (zero-initialised by the caller). |
| k_ra8_ok | Backend bound; bd is usable once the card is up. |
| k_ra8_err_null_ptr | bd was NULL. |
Definition at line 206 of file ra8_io_blockdev_sdspi.c.
References ra8_io_blockdev_t::ctx, ra8_io_blockdev_t::iface, k_ra8_ok, RA8_CHECK_NULL_PTR, s_sdspi_iface, and s_tag.
Referenced by internal_sd_demo_roundtrip().