pico-stuff/lib/littlefs/lfs_rp2040.h

28 wiersze
1.1 KiB
C
Czysty Zwykły widok Historia

2023-01-28 23:04:43 +00:00
#ifndef LFS_RP2040_H
#define LFS_RP2040_H
#include <lfs.h>
#include <lfs_util.h>
// Read a region in a block. Negative error codes are propagated
// to the user.
int lfs_rp2040_read(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size);
// Program a region in a block. The block must have previously
// been erased. Negative error codes are propagated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
int lfs_rp2040_prog(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, const void *buffer, lfs_size_t size);
// Erase a block. A block must be erased before being programmed.
// The state of an erased block is undefined. Negative error codes
// are propagated to the user.
// May return LFS_ERR_CORRUPT if the block should be considered bad.
int lfs_rp2040_erase(const struct lfs_config *c, lfs_block_t block);
// Sync the state of the underlying block device. Negative error codes
// are propagated to the user.
int lfs_rp2040_sync(const struct lfs_config *c);
#endif