PebbleOS v4.45.0-142-gc51251f50
Loading...
Searching...
No Matches
partition.h File Reference
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <pbl/drivers/flash.h>

Data Structures

struct  pbl_flash_partition
 An area of the board's flash. More...
 

Macros

#define PBL_FLASH_PARTITION(name)    ((struct pbl_flash_partition){.offset = name##_OFFSET, .size = name##_SIZE})
 The partition described by the constants name_OFFSET and name_SIZE.
 

Functions

static bool pbl_flash_partition__in_range (struct pbl_flash_partition part, uint32_t offs, size_t len)
 
static int pbl_flash_partition_read (struct pbl_flash_partition part, uint32_t offs, void *buf, size_t len)
 Read data.
 
static int pbl_flash_partition_write (struct pbl_flash_partition part, uint32_t offs, const void *buf, size_t len)
 Write data.
 
static int pbl_flash_partition_erase (struct pbl_flash_partition part, uint32_t offs, size_t len)
 Erase a range.
 
static bool pbl_flash_partition_is_erased (struct pbl_flash_partition part, uint32_t offs, size_t len)
 Check whether a range is erased.
 
static int pbl_flash_partition_protect (struct pbl_flash_partition part)
 Protect a whole partition against writes and erases.