You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
613 B
21 lines
613 B
#pragma once
|
|
|
|
struct flash_dev;
|
|
|
|
struct flash_ops {
|
|
int (* read)(struct flash_dev *dev, uint32_t addr, void *data, size_t len);
|
|
int (* write)(struct flash_dev *dev, uint32_t addr, const void *data,
|
|
size_t len);
|
|
int (* erase)(struct flash_dev *dev, uint32_t addr, size_t len);
|
|
};
|
|
|
|
struct flash_dev {
|
|
struct flash_ops *ops;
|
|
void *priv;
|
|
};
|
|
|
|
struct flash_dev *flash_probe(void);
|
|
int flash_read(struct flash_dev *dev, uint32_t addr, void *data, size_t len);
|
|
int flash_write(struct flash_dev *dev, uint32_t addr, const void *data,
|
|
size_t len);
|
|
int flash_erase(struct flash_dev *dev, uint32_t addr, size_t len);
|
|
|