WizziLab / modem_ref_v5_3_217

Dependents:   modem_ref_helper_for_v5_3_217

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers alp_fs.h Source File

alp_fs.h

Go to the documentation of this file.
00001 /// ======================================================================
00002 ///
00003 /// Copyright (C) 20XX WizziLab
00004 /// All Rights Reserved
00005 ///
00006 /// =======================================================================
00007 ///
00008 /// @file           alp_fs.h
00009 /// @brief          ALP File System definitions
00010 /// =======================================================================
00011 
00012 #ifndef __ALP_FS_H__
00013 #define __ALP_FS_H__
00014 
00015 #include "alp.h"
00016 
00017 // =======================================================================
00018 // alp_config_t
00019 // -----------------------------------------------------------------------
00020 /// ALP Configuration File structure
00021 // =======================================================================
00022 TYPEDEF_STRUCT_PACKED
00023 {
00024     /// Retry-Policy Table
00025     alp_retry_policy_t  rpolt[ALP_RPOL_QTY];
00026     /// Number of URC that can be registered
00027     u8                  urc_qty;
00028     /// File ID of Root Key
00029     u8                  root_key_fid;
00030 } alp_config_t;
00031 #define FID_ALP_CFG_SIZE    sizeof(alp_config_t)
00032 
00033 // Default Retry Policies table
00034 #define ALP_DEFAULT_RPOL_TABLE { \
00035     /*     Background  Depth  Retries SlotMin SlotMax                            */ \
00036     ALP_RPOL(   0,      1,      0,      0,      0  ), /* ALP_RPOL_ONESHOT        */ \
00037     ALP_RPOL(   0,      1,      3,      1,      2  ), /* ALP_RPOL_ONESHOT_RETRY  */ \
00038     ALP_RPOL(   1,      4,      4,      1,      8  ), /* ALP_RPOL_FIFO_FAST      */ \
00039     ALP_RPOL(   1,      8,      8,      4,     32  ), /* ALP_RPOL_FIFO_SLOW      */ \
00040     ALP_RPOL(   1,      1,      4,      1,      8  ), /* ALP_RPOL_SINGLE_FAST    */ \
00041     ALP_RPOL(   1,      1,      8,      4,     32  ), /* ALP_RPOL_SINGLE_SLOW    */ \
00042     ALP_RPOL(   0,      1,      8,      1,     16  ), /* ALP_RPOL_ONESHOT_STICKY */ \
00043     ALP_RPOL(   0,      0,      0,      0,      0  ), /* ALP_RPOL_RFU_7          */ \
00044 }
00045 
00046 // Instanciate ALP Configuration File:
00047 // _f   : ALP Config File ID
00048 // _frk : Root Key File ID
00049 // _r   : ALP "Retry Policies" Table
00050 // _u   : Number of ALP URCs
00051 #define ALP_FILE_INSTANCE(_f,_frk,_r,_u) \
00052 alp_config_t f_alp_cfg FS_USER_SECTION = { \
00053     .rpolt          = _r, \
00054     .urc_qty        = _u, \
00055     .root_key_fid   = _frk}; \
00056 FS_HDR_EEP(f_alp_cfg, _f, FID_ALP_CFG_SIZE, FS_READ_ONLY, FS_PERMANENT, 0, 0)
00057 
00058 #define ALP_DEFAULT_FILE_INSTANCE(_f,_frk,_u) ALP_FILE_INSTANCE(_f,_frk,ALP_DEFAULT_RPOL_TABLE,_u)
00059 
00060 
00061 #endif // __ALP_FS_H__