|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Public test-accessor API for the SDHC emulator driver. More...
Go to the source code of this file.
Functions | |
| int | sdhc_emul_set_fault (const struct device *dev, uint8_t cmd_index) |
| Set fault injection on a specific CMD index. | |
| int | sdhc_emul_clear_fault (const struct device *dev) |
| Clear any active fault injection. | |
| int | sdhc_emul_set_card_present (const struct device *dev, bool present) |
| Set the virtual card presence state. | |
| void | sdhc_emul_trigger_sdio_irq (const struct device *dev, uint8_t fn) |
| Trigger an SDIO interrupt. | |
| uint8_t * | sdhc_emul_get_storage (const struct device *dev) |
| Get a pointer to the emulated card storage. | |
| int | sdhc_emul_get_block_count (const struct device *dev, uint32_t *count) |
| Get the number of blocks in the emulated card. | |
Public test-accessor API for the SDHC emulator driver.
These functions allow test code to manipulate the internal state of the emulated SDHC host controller (fault injection, card presence, SDIO IRQ triggering). They are not part of the stable Zephyr API and are intended only for ztest use.
| int sdhc_emul_clear_fault | ( | const struct device * | dev | ) |
Clear any active fault injection.
Restores normal operation so that all commands are processed.
| dev | SDHC emulator device. |
| 0 | Success. |
| -ENODEV | No emulated card is registered. |
Get the number of blocks in the emulated card.
| dev | SDHC emulator device. |
| count | Number of blocks. |
| 0 | Success. |
| -ENODEV | No emulated card is registered. |
Get a pointer to the emulated card storage.
Useful for test verification of written data without issuing additional read commands.
| dev | SDHC emulator device. |
| NULL | No emulated card is registered. |
Set the virtual card presence state.
| dev | SDHC emulator device. |
| present | true if the card should appear inserted. |
| 0 | Success. |
| -ENODEV | No emulated card is registered. |
Set fault injection on a specific CMD index.
When a command with opcode == cmd_index is received by the emulator, it will return -EIO instead of processing the command.
| dev | SDHC emulator device. |
| cmd_index | CMD opcode to inject the fault on (0-63). |
| 0 | Success. |
| -ENODEV | No emulated card is registered. |
Trigger an SDIO interrupt.
Fires the registered SDHC interrupt callback with SDHC_INT_SDIO if that source is enabled. Does not modify the card CCCR interrupt pending register. fn is reserved for future use and is currently ignored.
| dev | SDHC emulator device. |
| fn | SDIO function number (1-7); unused. |