DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
app_nvm.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 #ifndef _APP_NVM_H
26 #define _APP_NVM_H
27 
28 #include "techtype.h"
29 #include "stbhwc.h"
30 
31 //---constant definitions---------------------------------------------------------------------------
32 //#define MAX_FAV_GRPS 4
33 
34 //---typedefs-structs-enumerations------------------------------------------------------------------
35 
36 //**************************************************************************************************
37 //****** To add a new NVM item ******
38 //****** --------------------------------------------------------------------------------- ******
39 //****** ******
40 //****** 1. Add new nvm item to bottom of e_nvm_items e.g. ITEM_NEW_NVM above NUM_ITEMS_NVM ******
41 //****** 2. See notes in app_nvm.c ******
42 //**************************************************************************************************
43 
44 //for use when using APP_NvmReadDefault, APP_NvmRead, APP_NvmSave in screens
45 //to access required nvm items
46 typedef enum e_nvm_items
47 {
48  FIRST_BOOT_NVM,
49  STANDBY_POWERSAVE_NVM,
50  VOLUME_NVM,
51  ASPECT_MODE_NVM,
52  SCART_INPUT_TYPE_NVM,
53  PRIMARY_AUDIO_LANG_NVM,
54  SECONDARY_AUDIO_LANG_NVM,
55  AUDIO_TYPE_NVM,
56  STANDBY_STATE_NVM,
57  SEARCHING_STATE_NVM,
58  PARENTAL_LOCK_NVM,
59  ICS_PARENTAL_LOCK_NVM,
60  SYSTEM_PIN_NO_NVM,
61  AERIAL_POWER_ON_NVM,
62  COUNTRY_CODE_NVM,
63  REGION_ID_NVM,
64  RF_CHANNEL_NUM_NVM,
65  ASPECT_RATIO_NVM,
66  TV_SCART_TYPE_NVM,
67  WAKEUP_VOLUME_NVM,
68  HDMI_RESOLUTION_NVM,
69  NET_IF_TYPE_NVM,
70  IP_MODE_NVM,
71  IP_ADDRESS_NVM,
72  SUBNET_MASK_NVM,
73  GATEWAY_IP_NVM,
74  DNS_SERVER_IP_NVM,
75  ESSID_NVM,
76  ESSID_PASSWORD_NVM,
77  AD_VOLUME_NVM,
78  SPDIF_OUTPUT_NVM,
79  LIP_SYNC_ADJUSTMENT_NVM,
80  TARGET_REGION_DEPTH_NVM,
81  TARGET_REGION_COUNTRY_NVM,
82  TARGET_REGION_PRIMARY_NVM,
83  TARGET_REGION_SECONDARY_NVM,
84  TARGET_REGION_TERTIARY_NVM,
85  OTA_TYPE_NVM,
86  OTA_LAST_UPDATE_SRCH_NVM,
87  LAST_CHAN_SRCH_NVM,
88  LAST_EIT_UPDATE_NVM,
89  WATCH_HD_PROGRAMMES_NVM,
90  RECORD_HD_PROGRAMMES_NVM,
91  TIMESHIFT_BUFFER_SIZE_NVM,
92  SUBTITLE_TYPE_NVM,
93  BACKGROUND_SEARCH_START_NVM,
94  BACKGROUND_SEARCH_END_NVM,
95  SERVICE_SEARCH_ENABLED_NVM,
96  SSU_SEARCH_ENABLED_NVM,
97  LIVE_SERVICE_LCN_NVM,
98  PRIMARY_TEXT_LANG_NVM,
99  SECONDARY_TEXT_LANG_NVM,
100  HDMI_AUDIO_OUTPUT_NVM,
101  EIT_SCHED_LIMIT_NVM,
102  PREFER_HD_AUDIO_NVM,
103 #if defined(COMMON_INTERFACE)
104  CICAM_ID0_0_NVM,
105  CICAM_ID0_1_NVM,
106  CICAM_PIN0_NVM,
107  CICAM_PIN0_USED_TIME_NVM,
108  CICAM_ID1_0_NVM,
109  CICAM_ID1_1_NVM,
110  CICAM_PIN1_NVM,
111  CICAM_PIN1_USED_TIME_NVM,
112  CICAM_ID2_0_NVM,
113  CICAM_ID2_1_NVM,
114  CICAM_PIN2_NVM,
115  CICAM_PIN2_USED_TIME_NVM,
116  CICAM_ID3_0_NVM,
117  CICAM_ID3_1_NVM,
118  CICAM_PIN3_NVM,
119  CICAM_PIN3_USED_TIME_NVM,
120 #endif
121  NUM_ITEMS_NVM
122 } E_NVM_ITEMS;
123 
124 typedef enum
125 {
126  STDBY_POWER_ON = 0,
127  STDBY_STANDBY,
128  STDBY_WAKE_FOR_SEARCH,
129  STDBY_UPDATE_SEARCH,
130  STDBY_WAKE_FOR_RECORDING,
131  STDBY_RECORDING
132 } E_STANDBY_STATE;
133 
134 typedef enum
135 {
136  OTA_TYPE_AUTO = 0,
137  OTA_TYPE_MANUAL
138 } E_OTA_TYPE;
139 
140 typedef enum
141 {
142  VIEW_REC_NEVER = 0,
143  VIEW_REC_ASK,
144  VIEW_REC_ALWAYS
145 } E_VIEW_REC_PREF;
146 
147 typedef enum
148 {
149  SUBTITLE_NORMAL = 0,
150  SUBTITLE_HARD_OF_HEARING
151 } E_SUBTITLE_TYPE;
152 
153 typedef enum
154 {
155  PARENTAL_LOCK_OFF = 0,
156  PARENTAL_LOCK_ON = 0xff
157 } E_PARENTAL_LOCK;
158 
159 typedef enum
160 {
161  NET_IF_NONE,
162  NET_IF_WIRED,
163  NET_IF_WIRELESS
164 } E_NET_IF_TYPE;
165 
166 //---Global function prototypes--------------------------------------------------------------------
167 
171 void APP_NvmRestoreDefaults(void);
172 
178 U32BIT APP_NvmReadDefault(E_NVM_ITEMS nvm_item);
179 
185 U32BIT APP_NvmRead(E_NVM_ITEMS nvm_item);
186 
192 U8BIT *APP_NvmReadString(E_NVM_ITEMS nvm_item);
193 
202 void APP_NvmSave(E_NVM_ITEMS nvm_item, U32BIT new_value, BOOLEAN write_to_flash_now);
203 
212 void APP_NvmSaveString(E_NVM_ITEMS nvm_item, U8BIT *str_ptr, BOOLEAN write_to_flash_now);
213 
217 void APP_NvmSaveAllNow(void);
218 
223 U32BIT APP_NvmGetDvbSize(void);
224 
225 //---Global functions for internal use ------------------------------------------------------------
226 
230 void APP_NvmInitialise(void);
231 
232 #endif // _APP_NVM_H
233 //**************************************************************************************************
234 // ---ooO END OF FILE Ooo---
235 //**************************************************************************************************
void APP_NvmRestoreDefaults(void)
Resets the DVB's settings to factory defaults.
Definition: app_nvm.c:492
Function prototypes for HW control.
U32BIT APP_NvmGetDvbSize(void)
Returns the size in bytes the DVB module uses to save its settings.
Definition: app_nvm.c:753
U32BIT APP_NvmRead(E_NVM_ITEMS nvm_item)
Returns the current value for the given DVB setting.
Definition: app_nvm.c:553
void APP_NvmSave(E_NVM_ITEMS nvm_item, U32BIT new_value, BOOLEAN write_to_flash_now)
Sets the current value for the given DVB setting.
Definition: app_nvm.c:625
U8BIT * APP_NvmReadString(E_NVM_ITEMS nvm_item)
Returns pointer to current string for the given DVB setting.
Definition: app_nvm.c:596
System Wide Global Technical Data Type Definitions.
U32BIT APP_NvmReadDefault(E_NVM_ITEMS nvm_item)
Returns the factory default value for the given DVB setting.
Definition: app_nvm.c:510
void APP_NvmSaveAllNow(void)
Saves DVB values immediately.
Definition: app_nvm.c:741
void APP_NvmSaveString(E_NVM_ITEMS nvm_item, U8BIT *str_ptr, BOOLEAN write_to_flash_now)
Sets the current value for the given DVB setting.
Definition: app_nvm.c:713
void APP_NvmInitialise(void)
Initialises the DVB core's NVM data.
Definition: app_nvm.c:464