DVBCore  22.3.0
Open Source DVB Engine
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  PVR_NOTIFY_TIME_NVM,
104  RECORD_START_PADDING_NVM,
105  RECORD_END_PADDING_NVM,
106 #if defined(COMMON_INTERFACE)
107  CICAM_ID0_0_NVM,
108  CICAM_ID0_1_NVM,
109  CICAM_PIN0_NVM,
110  CICAM_PIN0_USED_TIME_NVM,
111  CICAM_ID1_0_NVM,
112  CICAM_ID1_1_NVM,
113  CICAM_PIN1_NVM,
114  CICAM_PIN1_USED_TIME_NVM,
115  CICAM_ID2_0_NVM,
116  CICAM_ID2_1_NVM,
117  CICAM_PIN2_NVM,
118  CICAM_PIN2_USED_TIME_NVM,
119  CICAM_ID3_0_NVM,
120  CICAM_ID3_1_NVM,
121  CICAM_PIN3_NVM,
122  CICAM_PIN3_USED_TIME_NVM,
123 #endif
124  NUM_ITEMS_NVM
125 } E_NVM_ITEMS;
126 
127 typedef enum
128 {
129  STDBY_POWER_ON = 0,
130  STDBY_STANDBY,
131  STDBY_WAKE_FOR_SEARCH,
132  STDBY_UPDATE_SEARCH,
133  STDBY_WAKE_FOR_RECORDING,
134  STDBY_RECORDING
135 } E_STANDBY_STATE;
136 
137 typedef enum
138 {
139  OTA_TYPE_AUTO = 0,
140  OTA_TYPE_MANUAL
141 } E_OTA_TYPE;
142 
143 typedef enum
144 {
145  VIEW_REC_NEVER = 0,
146  VIEW_REC_ASK,
147  VIEW_REC_ALWAYS
148 } E_VIEW_REC_PREF;
149 
150 typedef enum
151 {
152  SUBTITLE_NORMAL = 0,
153  SUBTITLE_HARD_OF_HEARING
154 } E_SUBTITLE_TYPE;
155 
156 typedef enum
157 {
158  PARENTAL_LOCK_OFF = 0,
159  PARENTAL_LOCK_ON = 0xff
160 } E_PARENTAL_LOCK;
161 
162 typedef enum
163 {
164  NET_IF_NONE,
165  NET_IF_WIRED,
166  NET_IF_WIRELESS
167 } E_NET_IF_TYPE;
168 
169 //---Global function prototypes--------------------------------------------------------------------
170 
174 void APP_NvmRestoreDefaults(void);
175 
181 U32BIT APP_NvmReadDefault(E_NVM_ITEMS nvm_item);
182 
188 U32BIT APP_NvmRead(E_NVM_ITEMS nvm_item);
189 
195 U8BIT *APP_NvmReadString(E_NVM_ITEMS nvm_item);
196 
205 void APP_NvmSave(E_NVM_ITEMS nvm_item, U32BIT new_value, BOOLEAN write_to_flash_now);
206 
215 void APP_NvmSaveString(E_NVM_ITEMS nvm_item, U8BIT *str_ptr, BOOLEAN write_to_flash_now);
216 
220 void APP_NvmSaveAllNow(void);
221 
226 U32BIT APP_NvmGetDvbSize(void);
227 
228 //---Global functions for internal use ------------------------------------------------------------
229 
233 void APP_NvmInitialise(void);
234 
235 #endif // _APP_NVM_H
236 //**************************************************************************************************
237 // ---ooO END OF FILE Ooo---
238 //**************************************************************************************************
void APP_NvmRestoreDefaults(void)
Resets the DVB's settings to factory defaults.
Definition: app_nvm.c:501
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:762
U32BIT APP_NvmRead(E_NVM_ITEMS nvm_item)
Returns the current value for the given DVB setting.
Definition: app_nvm.c:562
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:634
U8BIT * APP_NvmReadString(E_NVM_ITEMS nvm_item)
Returns pointer to current string for the given DVB setting.
Definition: app_nvm.c:605
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:519
void APP_NvmSaveAllNow(void)
Saves DVB values immediately.
Definition: app_nvm.c:750
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:722
void APP_NvmInitialise(void)
Initialises the DVB core's NVM data.
Definition: app_nvm.c:473