|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Interfaces for Memory Controllers (MEMC). More...
Files | |
| file | memc.h |
| Main header file for Memory Controller (MEMC) driver API. | |
Data Structures | |
| struct | memc_driver_api |
| @driver_ops{MEMC} More... | |
Functions | |
| 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. | |
| int | memc_get_size (const struct device *dev, uint64_t *size) |
| Get the size of external memory. | |
| int | memc_read_id (const struct device *dev, uint8_t *id, size_t len) |
| Read the ID of external memory. | |
| typedef int(* | memc_api_read) (const struct device *dev, uint32_t addr, uint8_t *data, size_t len) |
| @def_driverbackendgroup{MEMC,memc_interface} | |
| typedef 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. | |
| typedef int(* | memc_api_get_size) (const struct device *dev, uint64_t *size) |
| Callback API for getting the size of external memory. | |
| typedef int(* | memc_api_read_id) (const struct device *dev, uint8_t *id, size_t len) |
| Callback API for reading the ID of external memory. | |
| typedef void *(* | memc_api_get_mem_base) (const struct device *dev) |
| Callback API for getting the base address of external memory. | |
Interfaces for Memory Controllers (MEMC).
| typedef void *(* memc_api_get_mem_base) (const struct device *dev) |
#include <memc.h>
Callback API for getting the base address of external memory.
See memc_get_mem_base() for argument description.
#include <memc.h>
Callback API for getting the size of external memory.
See memc_get_size() for argument description.
#include <memc.h>
@def_driverbackendgroup{MEMC,memc_interface}
Callback API for reading from external memory. See memc_read() for argument description.
#include <memc.h>
Callback API for reading the ID of external memory.
See memc_read_id() for argument description.
| typedef int(* memc_api_write) (const struct device *dev, uint32_t addr, const uint8_t *data, size_t len) |
#include <memc.h>
Callback API for writing to external memory.
See memc_write() for argument description.
|
inlinestatic |
#include <memc.h>
Get the memory-mapped base address of a MEMC device.
| dev | MEMC device. |
#include <memc.h>
Get the size of external memory.
| dev | MEMC device. |
| size | Pointer to variable to store size in bytes. |
| -ENOTSUP | if the device does not implement the memc API or the optional callback. |
#include <memc.h>
Read data from external memory.
| dev | MEMC device. |
| addr | Byte offset from the base address to read from. |
| data | Buffer to store read data. |
| len | Number of bytes to read. |
| -ENOTSUP | if the device does not implement the memc API, or if neither get_mem_base nor read is implemented. |
#include <memc.h>
Read the ID of external memory.
| dev | MEMC device. |
| id | Buffer to store ID (size depends on device, typically 2-4 bytes). |
| len | Number of bytes to read. Drivers may return fewer bytes than requested if the device ID is shorter. |
| -ENOTSUP | if the device does not implement the memc API or the optional callback. |
#include <memc.h>
Write data to external memory.
| dev | MEMC device. |
| addr | Byte offset from the base address to write to. |
| data | Buffer containing data to write. |
| len | Number of bytes to write. |
| -ENOTSUP | if the device does not implement the memc API, or if neither get_mem_base nor write is implemented. |