TT-System-Firmware APIs 19.10.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
flash_stm32_wrapper.c File Reference
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/flash.h>
#include <stdint.h>
Include dependency graph for flash_stm32_wrapper.c:

Data Structures

struct  flash_stm32_wrapper_config

Macros

#define DT_DRV_COMPAT   tenstorrent_stm32_flash_wrapper
#define FLASH_STM32_DEVICE(inst)
#define TT_STM32_FLASH_WRAPPER(inst)

Functions

static int flash_stm32_wrapper_erase (const struct device *dev, off_t offset, size_t len)
static int flash_stm32_wrapper_write (const struct device *dev, off_t offset, const void *data, size_t len)
static int flash_stm32_wrapper_read (const struct device *dev, off_t offset, void *data, size_t len)
static const struct flash_parametersflash_stm32_wrapper_get_parameters (const struct device *dev)
static int flash_stm32_wrapper_get_size (const struct device *dev, uint64_t *size)
static DEVICE_API (flash, drv_api)

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_stm32_flash_wrapper

◆ FLASH_STM32_DEVICE

#define FLASH_STM32_DEVICE ( inst)
Value:
DT_INST_PHANDLE(inst, flash_device)
#define DT_INST_PHANDLE(inst, prop)

◆ TT_STM32_FLASH_WRAPPER

#define TT_STM32_FLASH_WRAPPER ( inst)
Value:
const struct flash_stm32_wrapper_config dev##inst##_config = { \
.flash_dev = DEVICE_DT_GET(FLASH_STM32_DEVICE(inst)), \
.page_size = DT_INST_PROP(inst, page_size), \
.layout = \
{ \
.pages_count = \
DT_INST_REG_SIZE(inst) / DT_INST_PROP(inst, page_size), \
.pages_size = DT_INST_PROP(inst, page_size), \
}, \
}; \
DEVICE_DT_INST_DEFINE(inst, NULL, NULL, NULL, &dev##inst##_config, POST_KERNEL, \
CONFIG_FLASH_INIT_PRIORITY, &drv_api);
#define NULL
Definition avs.c:45
#define FLASH_STM32_DEVICE(inst)
Definition flash_stm32_wrapper.c:21
#define DEVICE_DT_GET(node_id)
#define DT_INST_PROP(inst, prop)
Definition flash_stm32_wrapper.c:15

Function Documentation

◆ DEVICE_API()

DEVICE_API ( flash ,
drv_api  )
static

◆ flash_stm32_wrapper_erase()

int flash_stm32_wrapper_erase ( const struct device * dev,
off_t offset,
size_t len )
static

◆ flash_stm32_wrapper_get_parameters()

const struct flash_parameters * flash_stm32_wrapper_get_parameters ( const struct device * dev)
static

◆ flash_stm32_wrapper_get_size()

int flash_stm32_wrapper_get_size ( const struct device * dev,
uint64_t * size )
static

◆ flash_stm32_wrapper_read()

int flash_stm32_wrapper_read ( const struct device * dev,
off_t offset,
void * data,
size_t len )
static

◆ flash_stm32_wrapper_write()

int flash_stm32_wrapper_write ( const struct device * dev,
off_t offset,
const void * data,
size_t len )
static