2016-06-12 20:43:24 +00:00
|
|
|
//
|
2018-03-28 17:09:40 +00:00
|
|
|
// Copyright (C) 2015-2018 Markus Hiienkari <mhiienka@niksula.hut.fi>
|
2016-06-12 20:43:24 +00:00
|
|
|
//
|
|
|
|
// This file is part of Open Source Scan Converter project.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef USERDATA_H_
|
|
|
|
#define USERDATA_H_
|
|
|
|
|
|
|
|
#include "alt_types.h"
|
2016-10-20 22:19:53 +00:00
|
|
|
#include "sysconfig.h"
|
2016-12-29 22:14:12 +00:00
|
|
|
#include "controls.h"
|
2017-01-08 10:02:32 +00:00
|
|
|
#include "av_controller.h"
|
2016-12-29 22:14:12 +00:00
|
|
|
#include "avconfig.h"
|
|
|
|
#include "video_modes.h"
|
|
|
|
#include "flash.h"
|
|
|
|
|
2018-11-03 16:28:30 +00:00
|
|
|
#define PROFILE_NAME_LEN 12
|
|
|
|
|
2018-10-22 18:47:25 +00:00
|
|
|
#define MAX_PROFILE (MAX_USERDATA_ENTRY-1)
|
2017-01-08 10:02:32 +00:00
|
|
|
#define INIT_CONFIG_SLOT MAX_USERDATA_ENTRY
|
2016-12-29 22:14:12 +00:00
|
|
|
|
2017-11-02 15:08:30 +00:00
|
|
|
#define UDATA_IMPT_CANCELLED 104
|
|
|
|
|
2016-12-29 22:14:12 +00:00
|
|
|
typedef enum {
|
2017-01-08 10:02:32 +00:00
|
|
|
UDE_INITCFG = 0,
|
2016-12-29 22:14:12 +00:00
|
|
|
UDE_PROFILE,
|
|
|
|
} ude_type;
|
2016-06-12 20:43:24 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char userdata_key[8];
|
|
|
|
alt_u8 version_major;
|
|
|
|
alt_u8 version_minor;
|
2016-12-29 22:14:12 +00:00
|
|
|
ude_type type;
|
|
|
|
} __attribute__((packed, __may_alias__)) ude_hdr;
|
2016-06-12 20:43:24 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2016-12-29 22:14:12 +00:00
|
|
|
ude_hdr hdr;
|
|
|
|
alt_u16 data_len;
|
2017-12-10 22:51:50 +00:00
|
|
|
alt_u8 last_profile[AV_LAST];
|
|
|
|
alt_u8 profile_link;
|
2017-01-08 10:02:32 +00:00
|
|
|
avinput_t last_input;
|
2017-11-10 22:23:51 +00:00
|
|
|
avinput_t def_input;
|
2018-03-28 17:09:40 +00:00
|
|
|
alt_u8 lcd_bl_timeout;
|
2018-02-04 15:01:11 +00:00
|
|
|
alt_u8 auto_input;
|
|
|
|
alt_u8 auto_av1_ypbpr;
|
|
|
|
alt_u8 auto_av2_ypbpr;
|
|
|
|
alt_u8 auto_av3_ypbpr;
|
2019-10-02 23:03:43 +00:00
|
|
|
alt_u8 osd_enable;
|
|
|
|
alt_u8 osd_status_timeout;
|
2016-12-29 22:14:12 +00:00
|
|
|
alt_u16 keys[REMOTE_MAX_KEYS];
|
2017-01-08 10:02:32 +00:00
|
|
|
} __attribute__((packed, __may_alias__)) ude_initcfg;
|
2016-06-12 20:43:24 +00:00
|
|
|
|
2016-12-29 22:14:12 +00:00
|
|
|
typedef struct {
|
|
|
|
ude_hdr hdr;
|
2018-11-03 16:28:30 +00:00
|
|
|
char name[PROFILE_NAME_LEN+1];
|
2016-12-29 22:14:12 +00:00
|
|
|
alt_u16 avc_data_len;
|
|
|
|
alt_u16 vm_data_len;
|
|
|
|
avconfig_t avc;
|
|
|
|
mode_data_t vm[VIDEO_MODES_CNT];
|
|
|
|
} __attribute__((packed, __may_alias__)) ude_profile;
|
2016-06-12 20:43:24 +00:00
|
|
|
|
2016-12-29 22:14:12 +00:00
|
|
|
int write_userdata(alt_u8 entry);
|
2018-11-03 16:28:30 +00:00
|
|
|
int read_userdata(alt_u8 entry, int dry_run);
|
2017-11-02 15:08:30 +00:00
|
|
|
int import_userdata();
|
2016-06-12 20:43:24 +00:00
|
|
|
|
2016-12-29 22:14:12 +00:00
|
|
|
#endif
|