Nordic stack and drivers for the mbed BLE API Modified for HRM1017 for library 0.1.0
Fork of nRF51822 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 399 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 702 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 362 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 267 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 312 of file pstorage.cpp.
static void cmd_queue_init | ( | void | ) | [static] |
Initializes command queue.
Definition at line 282 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 431 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 548 of file pstorage.cpp.
Generated on Tue Jul 12 2022 14:11:58 by 1.7.2