Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_WallbotBLE_Challenge by
Utility internal functions.
Functions | |
static void | cmd_queue_element_init (uint32_t index) |
Initializes command queue element. | |
static void | cmd_queue_init (void) |
Initializes command queue. | |
static uint32_t | cmd_queue_enqueue (uint8_t opcode, pstorage_handle_t *p_storage_addr, uint8_t *p_data_addr, pstorage_size_t size, pstorage_size_t offset) |
Routine to enqueue a flash access operation. | |
static uint32_t | cmd_queue_dequeue (void) |
Dequeues a command element. | |
static void | app_notify (uint32_t result) |
Routine to notify application of any errors. | |
void | pstorage_sys_event_handler (uint32_t sys_evt) |
Handles Flash Access Result Events declared in pstorage_platform.h. | |
static uint32_t | swap_state_process (cmd_queue_element_t *p_cmd, uint32_t page_number, uint32_t head_word_size, uint32_t tail_word_size) |
Function for handling flash accesses when using swap. | |
static uint32_t | cmd_process (void) |
Routine called to actually issue the flash access request to the SoftDevice. |
Detailed Description
Utility functions needed for interfacing with flash through SoC APIs. SoC APIs are non blocking and provide the result of flash access through an event.
- Note:
- Only one flash access operation is permitted at a time by SoC. Hence a queue is maintained by this module.
Function Documentation
static void app_notify | ( | uint32_t | result ) | [static] |
Routine to notify application of any errors.
- Parameters:
-
[in] result Result of event being notified.
Definition at line 398 of file pstorage.cpp.
static uint32_t cmd_process | ( | void | ) | [static] |
Routine called to actually issue the flash access request to the SoftDevice.
- Return values:
-
NRF_SUCCESS on success, else an error code indicating reason for failure.
Definition at line 701 of file pstorage.cpp.
static uint32_t cmd_queue_dequeue | ( | void | ) | [static] |
Dequeues a command element.
- Return values:
-
NRF_SUCCESS on success, else an error code indicating reason for failure.
Definition at line 364 of file pstorage.cpp.
static void cmd_queue_element_init | ( | uint32_t | index ) | [static] |
Initializes command queue element.
- Parameters:
-
[in] index Element index being initialized.
Definition at line 269 of file pstorage.cpp.
static uint32_t cmd_queue_enqueue | ( | uint8_t | opcode, |
pstorage_handle_t * | p_storage_addr, | ||
uint8_t * | p_data_addr, | ||
pstorage_size_t | size, | ||
pstorage_size_t | offset | ||
) | [static] |
Routine to enqueue a flash access operation.
- Parameters:
-
[in] opcode Identifies operation requested to be enqueued. [in] p_storage_addr Identiifes module and flash address on which operation is requested. [in] p_data_addr Identifies data address for flash access. [in] size Size in bytes of data requested for the access operation. [in] offset Offset within the flash memory block at which operation is requested.
- Return values:
-
NRF_SUCCESS on success, else an error code indicating reason for failure.
- Note:
- All paramater check should be performed before requesting in an enqueue.
Definition at line 314 of file pstorage.cpp.
static void cmd_queue_init | ( | void | ) | [static] |
Initializes command queue.
Definition at line 284 of file pstorage.cpp.
void pstorage_sys_event_handler | ( | uint32_t | sys_evt ) |
Handles Flash Access Result Events declared in pstorage_platform.h.
- Parameters:
-
[in] sys_evt System event to be handled.
Definition at line 430 of file pstorage.cpp.
static uint32_t swap_state_process | ( | cmd_queue_element_t * | p_cmd, |
uint32_t | page_number, | ||
uint32_t | head_word_size, | ||
uint32_t | tail_word_size | ||
) | [static] |
Function for handling flash accesses when using swap.
__________________________________________________________ | Page | |________________________________________________________| | head | affected body (to be updated or cleared) | tail | |______|__________________________________________|______|
- Parameters:
-
[in] p_cmd Queue element being processed. [in] page_number The affected page number. [in] head_word_size Size of the head in number of words. [in] tail_word_size Size of the tail in number of words.
- Return values:
-
NRF_SUCCESS on success, else an error code indicating reason for failure.
Definition at line 547 of file pstorage.cpp.
Generated on Tue Jul 12 2022 13:52:31 by
