PMSIS BSP
|
Data Structures | |
struct | pi_partition_t |
partition information structure More... | |
Typedefs | |
typedef void * | pi_partition_table_t |
partition table object More... | |
Enumerations | |
enum | pi_partition_type_t |
Partition type. More... | |
enum | pi_partition_subtype_t |
Partition subtype. More... | |
Functions | |
pi_err_t | pi_partition_table_load (pi_device_t *flash, const pi_partition_table_t *table) |
Open a partition table from a flash device. More... | |
void | pi_partition_table_free (pi_partition_table_t table) |
Close an opened partition table from pi_partition_table_load. More... | |
const pi_partition_t * | pi_partition_find_first (const pi_partition_table_t table, const pi_partition_type_t type, const pi_partition_subtype_t subtype, const char *label) |
Find first partition based on one or more parameters. More... | |
static pi_err_t | pi_partition_close (const pi_partition_t *partition) |
Close an opened partition device. More... | |
static pi_err_t | pi_partition_read_async (const pi_partition_t *partition, const uint32_t partition_addr, void *data, const size_t size, pi_task_t *task) |
Enqueue an asynchronous read copy to the flash partition (from flash partition to processor). More... | |
static pi_err_t | pi_partition_read (const pi_partition_t *partition, const uint32_t partition_addr, void *data, const size_t size) |
Enqueue a read copy to the flash partition (from flash to processor). More... | |
static pi_err_t | pi_partition_write_async (const pi_partition_t *partition, const uint32_t partition_addr, const void *data, const size_t size, pi_task_t *task) |
Enqueue an asynchronous read copy to the flash partition (from processor to flash partition). More... | |
static pi_err_t | pi_partition_write (const pi_partition_t *partition, const uint32_t partition_addr, const void *data, const size_t size) |
Enqueue a write copy to the flash partition (from processor to flash). More... | |
static pi_err_t | pi_partition_erase_async (const pi_partition_t *partition, uint32_t partition_addr, int size, pi_task_t *task) |
Erase an area in the flash partition asynchronously. More... | |
static pi_err_t | pi_partition_erase (const pi_partition_t *partition, uint32_t partition_addr, int size) |
Erase an area in the flash partition. More... | |
size_t | pi_partition_get_size (const pi_partition_t *partition) |
Erase the whole flash partition asynchronously. More... | |
uint32_t | pi_partition_get_flash_offset (const pi_partition_t *partition) |
Get flash partition start offset. More... | |
The partition driver provides support for handling partition contained into a device storage. Currently, PMSIS and GAP SDK provide both partitions, binary firmware and filesystem.
The beginning of the filesystem partition is aligned on a flash sector. Thus, an erase partition operation at address zero does not affect the data of the previous partition.
typedef void* pi_partition_table_t |
enum pi_partition_type_t |
|
inlinestatic |
This function can be called to close an opened partition device once it is not needed anymore, in order to free all allocated resources. Once this function is called, the device is not accessible anymore and must be opened again before being used.
partition | The partition structure of the device to close. |
|
inlinestatic |
This will erase the specified area. The duration of this operation may be long and may be retrieved from the datasheet. If the flash only supports sector erasing, all the sectors partially or entirely covered by this aread will be erased. The caller is blocked until the operation is finished.
partition | The partition descriptor on which to do the operation. |
partition_addr | The address of the partition area to be erased. |
size | The size of the area to be erased. |
|
inlinestatic |
This will erase the specified area. The duration of this operation may be long and may be retrieved from the datasheet. If the flash only supports sector erasing, all the sectors partially or entirely covered by this aread will be erased. A task must be specified in order to specify how the caller should be notified when the transfer is finished.
partition | The partition descriptor on which to do the operation. |
partition_addr | The address of the partition area to be erased. |
size | The size of the area to be erased. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
const pi_partition_t* pi_partition_find_first | ( | const pi_partition_table_t | table, |
const pi_partition_type_t | type, | ||
const pi_partition_subtype_t | subtype, | ||
const char * | label | ||
) |
table | the partition table descriptor on which to do the operation. This table must be loaded before with pi_partition_table_load(...) |
type | Partition type, one of pi_partition_type_t values |
subtype | Partition subtype, one of pi_partition_subtype_t values. To find all partitions of given type, use pi_PARTITION_SUBTYPE_ANY. |
label | (optional) Partition label. Set this value if looking for partition with a specific name. Pass NULL otherwise. |
uint32_t pi_partition_get_flash_offset | ( | const pi_partition_t * | partition | ) |
partition | The partition where the offset will be fetched. |
size_t pi_partition_get_size | ( | const pi_partition_t * | partition | ) |
This will erase the entire partition. The duration of this operation may be long and may be retrieved from the datasheet. A task must be specified in order to specify how the caller should be notified when the transfer is finished.
partition | The partition descriptor on which to do the operation. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
This will erase the entire partition. The duration of this operation may be long and may be retrieved from the datasheet. The caller is blocked until the operation is finished.
partition | The partition descriptor on which to do the operation. |
partition | The partition where the size will be fetched. |
|
inlinestatic |
The copy will make a transfer between the flash partition and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
partition | The partition descriptor on which to do the copy. |
partition_addr | The address of the copy in the partition. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy |
|
inlinestatic |
The copy will make a transfer between the flash partition and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
partition | The partition descriptor on which to do the copy. |
partition_addr | The address of the copy in the partition. |
data | The buffer address of the copy. |
size | The size in bytes of the copy. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |
void pi_partition_table_free | ( | pi_partition_table_t | table | ) |
table | A reference of the partition table to free. |
pi_err_t pi_partition_table_load | ( | pi_device_t * | flash, |
const pi_partition_table_t * | table | ||
) |
flash | The flash device in which to fetch the partition table. |
table | A reference to the user table variable. if the return code is PI_OK, this pointer contains a reference to the new partition table. |
|
inlinestatic |
The copy will make a write transfer from one of the processor memory areas to the partition. The locations in the flash being written should have first been erased. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
partition | The partition descriptor on which to do the copy. |
partition_addr | The address of the copy in the partition. |
data | The address of the copy in the processor. |
size | The size in bytes of the copy |
|
inlinestatic |
The copy will make a transfer between the flash partition and one of the processor memory areas.
A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.
partition | The partition descriptor on which to do the copy. |
partition_addr | The address of the copy in the partition. |
data | The buffer address of the copy. |
size | The size in bytes of the copy. |
task | The task used to notify the end of transfer. See the documentation of pi_task_t for more details. |