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.

87 lines
2.0 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2017-2021. All rights reserved.
* Description: Unicable IAPI interface
* Author: Hisilicon
* Create: 2017-06-30
*/
#ifndef __IAPI_UNICABLE_H__
#define __IAPI_UNICABLE_H__
#include "uapi_frontend.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
/* * Step size for full band scan. */
#define SCR_D_SCAN_FREQ_STEP 4
#define SCR_D_SCAN_FREQ_STEP_MIN 2
#define SCR_USER_BAND_NUMBERS 8
#define SCR_D_MAX_USER_BAND 8
/* * Start frequency for full band scan. */
#define SCR_D_SCAN_FREQ_START 950
/* * End frequency for full band scan. */
#define SCR_D_SCAN_FREQ_END 2150
/* * AGC array length. */
#define SCR_ARRAY_LENGTH (SCR_D_SCAN_FREQ_END - SCR_D_SCAN_FREQ_START)
/* * Scan points for full band scan. */
#define SCR_D_SCAN_POINTS (((SCR_D_SCAN_FREQ_END) - (SCR_D_SCAN_FREQ_START)) / (SCR_D_SCAN_FREQ_STEP))
#define MIN_AGC_CHANGED_BETWEEN_ON_AND_OFF 600
#define MIN_DISTANCE_BETWEEN_UB_MHZ 80
/* * Max number of points maybe UBs after scan full band. */
#define SCR_D_MAX_POINTS_MAYBE_USER_BAND 160
#define HON_D_FREQ_OFFSET_NO 20 // unic MHz
#define CHAN_BYTE_SIZE 2 /* 2:size */
#define DISEQC_MSG_LENGTH 5
#define SCR_NO_MAX 4
#define unic_init_diseqc_send_msg(send_msg, tuner_id) \
do { \
(send_msg).level = UAPI_FRONTEND_DISEQC_LEVEL_1_X; \
(send_msg).tone_burst = diseqc_get_tone_burst_status(tuner_id); \
(send_msg).length = DISEQC_MSG_LENGTH; \
(send_msg).repeat_times = 0; \
} while (0)
typedef struct {
td_s32 freq;
td_s32 agc;
} scr_tone;
typedef struct {
td_u32 ub_index;
td_u32 curr_central_freq; /* unit:MHz */
td_u32 total_ub_number;
uapi_unicable_scr_ub ub_info[SCR_USER_BAND_NUMBERS];
} unicable_info;
typedef struct {
td_u32 port;
uapi_unicable_scan_para unic_scan_para;
} unicable_scan_para;
td_s32 unic_chan_change(td_u32 tuner_id, td_u32 freq_mhz, uapi_frontend_polarization polar);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif