|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Interfaces for Memory Controllers (MEMC). More...
Topics | |
| MEMC Driver Backend API | |
Files | |
| file | memc.h |
| Main header file for Memory Controller (MEMC) driver API. | |
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. | |
Interfaces for Memory Controllers (MEMC).
|
inlinestatic |
#include <zephyr/drivers/memc.h>
Get the memory-mapped base address of a MEMC device.
| dev | MEMC device. |
#include <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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 <zephyr/drivers/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. |