Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
SDHC Emulation Interface

SDHC Emulation Interface. More...

Data Structures

struct  sdhc_emul
 Node in a linked list of emulators for SDHC card devices. More...
struct  sdhc_emul_api
 Definition of the emulator API for SDHC card devices. More...

Typedefs

typedef int(* sdhc_emul_request_t) (const struct emul *target, struct sdhc_command *cmd, struct sdhc_data *data)
 Passes an SDHC request to the card emulator.
typedef int(* sdhc_emul_card_busy_t) (const struct emul *target)
 Check if the emulated card is busy.
typedef int(* sdhc_emul_card_present_t) (const struct emul *target)
 Check if the emulated card is present.

Functions

int sdhc_emul_register (const struct device *dev, struct sdhc_emul *emul)
 Register an emulated card device on the controller.
struct sdhc_emul * sdhc_emul_get_card (const struct device *dev)
 Find the first SDHC emulator registered on a controller.
void sdhc_emul_raise_interrupt (const struct device *dev, int sources)
 Raise an interrupt from an emulated SDHC card through its controller.

Detailed Description

SDHC Emulation Interface.

Typedef Documentation

◆ sdhc_emul_card_busy_t

typedef int(* sdhc_emul_card_busy_t) (const struct emul *target)

#include <zephyr/drivers/sdhc_emul.h>

Check if the emulated card is busy.

Parameters
targetThe device Emulator instance.
Return values
0Card is not busy.
1Card is busy.

◆ sdhc_emul_card_present_t

typedef int(* sdhc_emul_card_present_t) (const struct emul *target)

#include <zephyr/drivers/sdhc_emul.h>

Check if the emulated card is present.

Parameters
targetThe device Emulator instance.
Return values
0Card not present.
1Card present.

◆ sdhc_emul_request_t

typedef int(* sdhc_emul_request_t) (const struct emul *target, struct sdhc_command *cmd, struct sdhc_data *data)

#include <zephyr/drivers/sdhc_emul.h>

Passes an SDHC request to the card emulator.

Parameters
targetThe device Emulator instance.
cmdSDHC command to process.
dataOptional data transfer associated with the command.
Return values
0If successful.
-EIOGeneral input / output error.
-ENOTSUPCommand not supported.

Function Documentation

◆ sdhc_emul_get_card()

struct sdhc_emul * sdhc_emul_get_card ( const struct device * dev)

#include <zephyr/drivers/sdhc_emul.h>

Find the first SDHC emulator registered on a controller.

Parameters
devSDHC emulation controller device.
Returns
First emulator, or NULL when no card slot is registered.

◆ sdhc_emul_raise_interrupt()

void sdhc_emul_raise_interrupt ( const struct device * dev,
int sources )

#include <zephyr/drivers/sdhc_emul.h>

Raise an interrupt from an emulated SDHC card through its controller.

Parameters
devSDHC emulation controller device.
sourcesInterrupt source bits, using SDHC_INT_* values.

◆ sdhc_emul_register()

int sdhc_emul_register ( const struct device * dev,
struct sdhc_emul * emul )

#include <zephyr/drivers/sdhc_emul.h>

Register an emulated card device on the controller.

Parameters
devDevice that will use the emulator (the controller)
emulSDHC card emulator to register
Returns
0 indicating success (always)