You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.5 KiB
129 lines
3.5 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2017-2021. All rights reserved.
|
|
* Description: SAT IAPI interface
|
|
* Author: Hisilicon
|
|
* Created: 2017-06-30
|
|
*/
|
|
|
|
#ifndef __IAPI_SAT_H__
|
|
#define __IAPI_SAT_H__
|
|
|
|
#include "uapi_frontend.h"
|
|
#include "drv_frontend_struct.h"
|
|
#include "pthread.h"
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#endif /* __cplusplus */
|
|
|
|
#define SAT_C_MIN (3000)
|
|
#define SAT_C_MAX (4200)
|
|
#define SAT_KU_MIN (10600)
|
|
#define SAT_KU_MAX (12750)
|
|
#define SAT_IF_MIN_KHZ (950000)
|
|
#define SAT_IF_MAX_KHZ (2150000)
|
|
#define SAT_C_MIN_KHZ (3000000)
|
|
#define SAT_C_MAX_KHZ (4200000)
|
|
#define SAT_KU_MIN_KHZ (10600000)
|
|
#define SAT_KU_MAX_KHZ (12750000)
|
|
|
|
#define SAT_SYMBOLRATE_MAX (72000000)
|
|
|
|
#define SAT_IF_MIN (950)
|
|
#define SAT_IF_MAX (2150)
|
|
#define SAT_IF_C_H_MIN (1550)
|
|
#define SAT_IF_C_H_MAX (2150)
|
|
#define SAT_IF_C_L_MIN (950)
|
|
#define SAT_IF_C_L_MAX (1550)
|
|
#define SAT_IF_KU_H_MIN_1 (1100)
|
|
#define SAT_IF_KU_H_MAX_1 (2150)
|
|
#define SAT_IF_KU_H_MIN_2 (950)
|
|
#define SAT_IF_KU_H_MAX_2 (2000)
|
|
#define SAT_IF_KU_L_MIN (950)
|
|
#define SAT_IF_KU_L_MAX (1950)
|
|
|
|
#define SAT_LO_C_L (5150)
|
|
#define SAT_LO_C_H (5750)
|
|
#define SAT_LO_KU_L_1 (9750)
|
|
#define SAT_LO_KU_H_1 (10600)
|
|
#define SAT_LO_KU_L_2 (9750)
|
|
#define SAT_LO_KU_H_2 (10750)
|
|
|
|
#define MAX_BLINDSCAN_TIMES (4)
|
|
#define SAT_DOWNLINK_FREQ_KU_MID (11700)
|
|
|
|
#define BUF_TP_NUM 512 /* 1024 TQE check */
|
|
#define BS_ACTION_TIME_PERCENT 40
|
|
|
|
typedef struct {
|
|
td_u32 port;
|
|
uapi_frontend_blind_scan_para para;
|
|
} blindscan_para;
|
|
|
|
typedef struct {
|
|
td_u32 tp_num;
|
|
uapi_frontend_sat_tp_info tps[BUF_TP_NUM];
|
|
} blindscan_tp_result;
|
|
|
|
typedef struct {
|
|
uapi_frontend_lnb_22k lnb_22k;
|
|
uapi_frontend_polarization polar;
|
|
td_u16 start_freq; /* MHz */
|
|
td_u16 stop_freq; /* MHz */
|
|
} blindscan_condition_time;
|
|
|
|
typedef struct {
|
|
td_u32 scan_times;
|
|
blindscan_condition_time scan_cond[MAX_BLINDSCAN_TIMES];
|
|
} blindscan_ctrl_time;
|
|
|
|
typedef struct {
|
|
uapi_frontend_lnb_config lnb_config; /* LNB configuration */
|
|
uapi_frontend_lnb_power lnb_power; /* LNB power */
|
|
uapi_frontend_polarization polar; /* LNB polarization */
|
|
uapi_frontend_lnb_22k lnb_22k; /* LNB 22K on or off */
|
|
pthread_t* blindscan_monitor; /* Blind scan thread */
|
|
td_bool blindscan_stop; /* Blind scan stop flag */
|
|
td_bool blindscan_busy; /* Blind scan stop flag */
|
|
uapi_frontend_switch_22k_sta switch_22k;
|
|
uapi_frontend_switch_tone_burst_sta tone_burst;
|
|
} sat_status;
|
|
|
|
typedef struct {
|
|
ext_drv_frontend_fec_rate fec_rate;
|
|
td_float refer_snr;
|
|
} sat_refer_snr;
|
|
|
|
#define get_refer_snr(ref, array, code_rate) do { \
|
|
td_u32 i = 0; \
|
|
for (i = 0; i < sizeof(array) / sizeof(sat_refer_snr); i++) { \
|
|
if (((array)[i].fec_rate) == (code_rate)) { \
|
|
(ref) = ((array)[i].refer_snr); \
|
|
} \
|
|
} \
|
|
} while (0)
|
|
|
|
typedef struct {
|
|
td_u16 signal_level;
|
|
td_s16 signal_dbuv;
|
|
} tuner_signal_level_sat;
|
|
|
|
sat_status *sat_get_status(td_u32 port);
|
|
td_s32 sat_init(td_void);
|
|
td_s32 sat_get_default_timeout(td_u32 tuner_id,
|
|
const uapi_frontend_connect_para *connect_para, td_u32 *timeout_ms);
|
|
td_s32 sat_connect(td_u32 tuner_id, const uapi_frontend_connect_para *connect_para, td_u32 timeout);
|
|
td_s32 sat_get_real_freq_symb(td_u32 tuner_id, td_u32 *freq, td_u32 *symb);
|
|
td_s32 sat_get_signal_quality(td_u32 tuner_id, td_double snr, td_u32 *signal_quality);
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* __cplusplus */
|
|
|
|
#endif
|
|
|