summaryrefslogtreecommitdiffstats
path: root/api/driver_tua8010.h
blob: 175fe14ff3882f0ffa0a729986367534f8e15126 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* ============================================================================
** Copyright (C) 1997-2008 Infineon AP All rights reserved.
** ============================================================================
**
** ============================================================================
** Revision Information :
**    File name: driver_tua8010.h
**    Version: 2008.08.17
**    Date: V0.1
**
** ============================================================================
** History: 
** 
** Date         Author  Comment
** ----------------------------------------------------------------------------
**
** 2007.11.06   Walter Pichler    created.
** 2008.08.15   Xie Yonggang      adaption to TUA8010
** ============================================================================
*/

 
/*============================================================================
 Named Constants Definitions
============================================================================*/

#define TUNER_OK                       0
#define TUNER_ERR                      0xff

#define H_LEVEL                        1
#define L_LEVEL                        0


/*============================================================================
 Types definition
============================================================================*/


typedef enum {
        TUNER_BANDWIDTH_8MHZ,
        TUNER_BANDWIDTH_7MHZ,
        TUNER_BANDWIDTH_6MHZ,
        TUNER_BANDWIDTH_5MHZ,
        } tunerDriverBW_t;


typedef enum {
        PLL_LOCKED,
        PLL_NOT_LOCKED
        }tunerPllLocked_t;


typedef enum {
        STANDBY,
        IDLE,
        RX
        } tunerReceiverState_t;


typedef enum {
	      Internal_UHF_LNA,
	      External_UHF_LNA,
        Internal_VHF_LNA,
        External_VHF_LNA
        } tunerActiveInput_t;

 

/*============================================================================
 Public functions
============================================================================*/

/**
 * tuner initialisation
 * @retval TUNER_OK No error
 * @retval TUNER_ERROR Error
*/
extern int initializeTUA8010(void);


/**
 * tuner tune
 * @param IN i_freq   tuning frequency
 * @param IN i_bandwidth  channel  bandwidth
 * @retval TUNER_OK No error
 * @retval TUNER_ERROR Error
*/
extern int tuneTUA8010(long i_freq, tunerDriverBW_t i_bandwidth);


/**
 * Get tuner state
 * @param OUT o_tunerState tuner state
 * @retval TUNER_OK No error
 * @retval TUNER_ERROR Error
*/
extern int getReceiverStateTUA8010(tunerReceiverState_t *o_tunerState);

/**
 * Get active input
 * @param OUT o_activeInput active input info
 * @retval TUNER_OK No error
 * @retval TUNER_ERROR Error
*/
extern int getActiveInputTUA8010(tunerActiveInput_t *o_activeInput);


/**
 * Get baseband gain value
 * @param OUT o_basebandGain  baseband gain value
 * @retval TUNER_OK No error
 * @retval TUNER_ERROR Error
*/
extern int getBasebandGainTUA8010(char *o_basebandGain);