13#ifndef ZEPHYR_INCLUDE_DRIVERS_MEMC_H_
14#define ZEPHYR_INCLUDE_DRIVERS_MEMC_H_
69typedef void *(*memc_api_get_mem_base)(
const struct device *dev);
121 if (api->
read != NULL) {
122 return api->
read(dev, addr, data, len);
160 if (api->
write != NULL) {
161 return api->
write(dev, addr, data, len);
206static inline int z_impl_memc_get_size(
const struct device *dev,
uint64_t *size)
235static inline int z_impl_memc_read_id(
const struct device *dev,
uint8_t *
id,
size_t len)
247 return api->
read_id(dev,
id, len);
256#include <zephyr/syscalls/memc.h>
#define DEVICE_API_IS(_class, _dev)
Macro that evaluates to a boolean that can be used to check if a device is of a particular class.
Definition device.h:1406
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1425
void *(* memc_api_get_mem_base)(const struct device *dev)
Callback API for getting the base address of external memory.
Definition memc.h:69
int(* memc_api_read)(const struct device *dev, uint32_t addr, uint8_t *data, size_t len)
Callback API for reading from external memory.
Definition memc.h:44
int(* memc_api_get_size)(const struct device *dev, uint64_t *size)
Callback API for getting the size of external memory.
Definition memc.h:57
int(* memc_api_write)(const struct device *dev, uint32_t addr, const uint8_t *data, size_t len)
Callback API for writing to external memory.
Definition memc.h:50
int(* memc_api_read_id)(const struct device *dev, uint8_t *id, size_t len)
Callback API for reading the ID of external memory.
Definition memc.h:63
int memc_get_size(const struct device *dev, uint64_t *size)
Get the size of external memory.
int memc_read(const struct device *dev, uint32_t addr, uint8_t *data, size_t len)
Read data from external memory.
int memc_write(const struct device *dev, uint32_t addr, const uint8_t *data, size_t len)
Write data to external memory.
static void * memc_get_mem_base(const struct device *dev)
Get the memory-mapped base address of a MEMC device.
Definition memc.h:179
int memc_read_id(const struct device *dev, uint8_t *id, size_t len)
Read the ID of external memory.
#define ENOTSUP
Unsupported value.
Definition errno.h:114
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
void * memcpy(void *ZRESTRICT d, const void *ZRESTRICT s, size_t n)
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
void * data
Address of the device instance private data.
Definition device.h:523
<span class="mlabel">Driver Operations</span> MEMC driver operations
Definition memc.h:74
memc_api_get_mem_base get_mem_base
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition memc.h:80
memc_api_get_size get_size
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition memc.h:82
memc_api_read read
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition memc.h:76
memc_api_write write
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition memc.h:78
memc_api_read_id read_id
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition memc.h:84