|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io block-device backend over the native SDHI SD-card controller. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_io_blockdev_sdhi_init (ra8_io_blockdev_t *bd) |
| Bind the native-SDHI SD-card backend into a caller-owned handle. | |
ra8_io block-device backend over the native SDHI SD-card controller.
The SDHI backend exposes an SD/SDHC/SDXC card – driven over the RA8D2 4-bit SDHI controller through the ra8_sdcard HAL driver – as the fabric's 512-byte logical-block device. It is the high-throughput counterpart to the SD-over-SPI backend: both present the identical ra8_io_blockdev_iface, so a filesystem mounted on one mounts unchanged on the other.
The card is a singleton owned by ra8_sdcard, so this backend keeps no per-device state: it binds the const vtable into a caller-owned handle with a NULL context. The application must have brought the card up with ra8_sdcard_init before any I/O flows through the bound handle. The card has no host-visible erase primitive, so the vtable's erase slot is NULL and the fabric maps an erase request to k_ra8_err_not_supported.
Definition in file ra8_io_blockdev_sdhi.h.
|
nodiscard |
Bind the native-SDHI SD-card backend into a caller-owned handle.
Points bd at the SDHI vtable with a NULL context (the card is a singleton owned by ra8_sdcard). No allocation occurs; the caller owns bd. The card itself must already have been initialised with ra8_sdcard_init – this helper only wires the dispatch table and does not touch the controller.
| [out] | bd | Handle to bind (zero-initialised by the caller). |
| k_ra8_ok | Backend bound; bd is usable. |
| k_ra8_err_null_ptr | bd was NULL. |
Definition at line 174 of file ra8_io_blockdev_sdhi.c.
References ra8_io_blockdev_t::ctx, ra8_io_blockdev_t::iface, k_ra8_ok, RA8_CHECK_NULL_PTR, s_sdhi_iface, and s_tag.
Referenced by sdhi_demo_mount_via_io().