00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(_BD_REGISTER_H_)
00021 #define _BD_REGISTER_H_
00022
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026
00027 #include <util/attributes.h>
00028
00029 #include <stdint.h>
00030
00031
00032
00033
00034
00035 typedef enum {
00036 PSR_IG_STREAM_ID = 0,
00037 PSR_PRIMARY_AUDIO_ID = 1,
00038 PSR_PG_STREAM = 2,
00039 PSR_ANGLE_NUMBER = 3,
00040 PSR_TITLE_NUMBER = 4,
00041 PSR_CHAPTER = 5,
00042 PSR_PLAYLIST = 6,
00043 PSR_PLAYITEM = 7,
00044 PSR_TIME = 8,
00045 PSR_NAV_TIMER = 9,
00046 PSR_SELECTED_BUTTON_ID = 10,
00047 PSR_MENU_PAGE_ID = 11,
00048 PSR_STYLE = 12,
00049 PSR_PARENTAL = 13,
00050 PSR_SECONDARY_AUDIO_VIDEO = 14,
00051 PSR_AUDIO_CAP = 15,
00052 PSR_AUDIO_LANG = 16,
00053 PSR_PG_AND_SUB_LANG = 17,
00054 PSR_MENU_LANG = 18,
00055 PSR_COUNTRY = 19,
00056 PSR_REGION = 20,
00057 PSR_VIDEO_CAP = 29,
00058 PSR_TEXT_CAP = 30,
00059 PSR_PROFILE_VERSION = 31,
00060 PSR_BACKUP_PSR4 = 36,
00061 PSR_BACKUP_PSR5 = 37,
00062 PSR_BACKUP_PSR6 = 38,
00063 PSR_BACKUP_PSR7 = 39,
00064 PSR_BACKUP_PSR8 = 40,
00065 PSR_BACKUP_PSR10 = 42,
00066 PSR_BACKUP_PSR11 = 43,
00067 PSR_BACKUP_PSR12 = 44,
00068
00069 } bd_psr_idx;
00070
00071 #define DEFAULT_LANGUAGE "eng"
00072
00073
00074 typedef struct bd_registers_s BD_REGISTERS;
00075
00082 BD_PRIVATE BD_REGISTERS *bd_registers_init(void);
00083
00090 BD_PRIVATE void bd_registers_free(BD_REGISTERS *);
00091
00092
00093
00094
00095
00096
00105 uint32_t bd_gpr_read(BD_REGISTERS *, int reg);
00106
00116 int bd_gpr_write(BD_REGISTERS *, int reg, uint32_t val);
00117
00118
00119
00120
00121
00122
00131 uint32_t bd_psr_read(BD_REGISTERS *, int reg);
00132
00144 int bd_psr_write(BD_REGISTERS *, int reg, uint32_t val);
00145
00157 int bd_psr_setting_write(BD_REGISTERS *, int reg, uint32_t val);
00158
00165 void bd_psr_lock(BD_REGISTERS *);
00166
00173 void bd_psr_unlock(BD_REGISTERS *);
00174
00183 void bd_psr_save_state(BD_REGISTERS *);
00184
00194 void bd_psr_restore_state(BD_REGISTERS *);
00195
00204 void bd_psr_reset_backup_registers(BD_REGISTERS *);
00205
00206
00207
00208
00209
00210
00211
00212 #define BD_PSR_SAVE 1
00213 #define BD_PSR_WRITE 2
00214 #define BD_PSR_CHANGE 3
00215 #define BD_PSR_RESTORE 4
00216
00217
00218 typedef struct {
00219 int ev_type;
00220
00221 int psr_idx;
00222 uint32_t old_val;
00223 uint32_t new_val;
00224 } BD_PSR_EVENT;
00225
00236 void bd_psr_register_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle);
00237
00246 void bd_psr_unregister_cb(BD_REGISTERS *, void (*callback)(void*,BD_PSR_EVENT*), void *cb_handle);
00247
00248 #ifdef __cplusplus
00249 };
00250 #endif
00251
00252 #endif