nRF5 SDK for Mesh v3.2.0  08c60f6

Flash Manager type definitions. More...

Data Structures

struct  fm_header_t
 Header prepending every flash entry in a flash manager. More...
 
struct  fm_handle_filter_t
 Handle filter, used to search through all handles to find matches. More...
 
struct  fm_entry_t
 Single flash manager entry. More...
 
struct  flash_manager_metadata_t
 Metadata structure denoting properties of a flash manager page. More...
 
union  flash_manager_page_t
 Single flash manager page. More...
 
struct  flash_manager_config_t
 Flash manager configuration structure, defines the user-configurable parts of the flash manager. More...
 
struct  flash_manager_internal_state_t
 Internal flash manager state, managed and used internally. More...
 
struct  flash_manager_t
 
struct  fm_mem_listener_t
 Memory listener. More...
 

Typedefs

typedef uint16_t fm_handle_t
 Flash manager handle type, used to identify entries in a flash manager area.
 
typedef void(* flash_manager_write_complete_cb_t) (const flash_manager_t *p_manager, const fm_entry_t *p_entry, fm_result_t result)
 Write complete callback, to give the user the result of an entry write action. More...
 
typedef void(* flash_manager_invalidate_complete_cb_t) (const flash_manager_t *p_manager, fm_handle_t handle, fm_result_t result)
 Invalidate complete callback, to give the user the result of an entry invalidation action. More...
 
typedef void(* flash_manager_remove_complete_cb_t) (const flash_manager_t *p_manager)
 Remove complete callback, indicating that the requested remove operation has been completed. More...
 
typedef void(* flash_manager_queue_empty_cb_t) (void)
 Action queue empty callback, indicating that the flash manager is finished processing all its ongoing actions.
 
typedef void(* flash_manager_mem_listener_cb_t) (void *p_args)
 Memory listener callback, that will be called once the flash manager has some memory available. More...
 
typedef fm_iterate_action_t(* flash_manager_read_cb_t) (const fm_entry_t *p_entry, void *p_args)
 Entry read callback type. More...
 

Enumerations

enum  fm_state_t {
  FM_STATE_UNINITIALIZED, FM_STATE_BUILDING, FM_STATE_READY, FM_STATE_DEFRAG,
  FM_STATE_REMOVING
}
 Valid state of a flash manager instance.
 
enum  fm_result_t { FM_RESULT_SUCCESS, FM_RESULT_ERROR_AREA_FULL, FM_RESULT_ERROR_NOT_FOUND, FM_RESULT_ERROR_FLASH_MALFUNCTION }
 Flash action result, returned in complete-callback. More...
 
enum  fm_iterate_action_t { FM_ITERATE_ACTION_STOP, FM_ITERATE_ACTION_CONTINUE }
 Action returned from the read callback, determining whether to continue the iteration. More...
 

Detailed Description

Flash Manager type definitions.

Typedef Documentation

◆ flash_manager_write_complete_cb_t

typedef void(* flash_manager_write_complete_cb_t) (const flash_manager_t *p_manager, const fm_entry_t *p_entry, fm_result_t result)

Write complete callback, to give the user the result of an entry write action.

Is called when the action is fully completed, but before any memory associated with it is freed.

Warning
If the result parameter indicates failure, the memory pointed to in p_entry is an in-RAM representation of the requested write, that will be freed after the call completes.
Parameters
[in]p_managerManager that executed the action.
[in]p_entryPointer to the resulting entry in flash if the action was successful, or pointer to the in-RAM representation if the action failed.
[in]resultResult of the action.

Definition at line 169 of file flash_manager.h.

◆ flash_manager_invalidate_complete_cb_t

typedef void(* flash_manager_invalidate_complete_cb_t) (const flash_manager_t *p_manager, fm_handle_t handle, fm_result_t result)

Invalidate complete callback, to give the user the result of an entry invalidation action.

Is called when the action is fully completed, but before any memory associated with it is freed.

Parameters
[in]p_managerManager that executed the action.
[in]handleHandle that was invalidated.
[in]resultResult of the action.

Definition at line 181 of file flash_manager.h.

◆ flash_manager_remove_complete_cb_t

typedef void(* flash_manager_remove_complete_cb_t) (const flash_manager_t *p_manager)

Remove complete callback, indicating that the requested remove operation has been completed.

Any flash memory associated with the given manager has been erased, and the manager and its flash area can safely be reused.

Parameters
[in]p_managerFlash manager that was removed.

Definition at line 193 of file flash_manager.h.

◆ flash_manager_mem_listener_cb_t

typedef void(* flash_manager_mem_listener_cb_t) (void *p_args)

Memory listener callback, that will be called once the flash manager has some memory available.

Parameters
[in]p_argsArguments pointer, as set by the listener.

Definition at line 234 of file flash_manager.h.

◆ flash_manager_read_cb_t

typedef fm_iterate_action_t(* flash_manager_read_cb_t) (const fm_entry_t *p_entry, void *p_args)

Entry read callback type.

See also
flash_manager_entries_read
Parameters
[in]p_entryA pointer to the flash entry that is read.
[in,out]p_argsThe p_args pointer that was passed to the flash_manager_entries_read function.
Return values
FM_ITERATE_ACTION_STOPTell the caller to stop iterating through the entries.
FM_ITERATE_ACTION_CONTINUETell the caller to continue iterating through the entries.

Definition at line 263 of file flash_manager.h.

Enumeration Type Documentation

◆ fm_result_t

Flash action result, returned in complete-callback.

Enumerator
FM_RESULT_SUCCESS 

The action completed successfully.

FM_RESULT_ERROR_AREA_FULL 

The managed flash area is full, and cannot accept any new entries.

FM_RESULT_ERROR_NOT_FOUND 

The entry wasn't present in the manager.

FM_RESULT_ERROR_FLASH_MALFUNCTION 

The flash HW malfunctioned, and the operation did not finish correctly.

Definition at line 149 of file flash_manager.h.

◆ fm_iterate_action_t

Action returned from the read callback, determining whether to continue the iteration.

Enumerator
FM_ITERATE_ACTION_STOP 

Stop iterating through the entries.

FM_ITERATE_ACTION_CONTINUE 

Continue iterating through the entries.

Definition at line 245 of file flash_manager.h.