summaryrefslogtreecommitdiff
path: root/drivers/misc/gpsip/cgdriver/CgxDriverPlatform.h
blob: ec38ab1f6fe9f68319d54fd3fbaf6bc629a126fe (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/******************************************************************************
 *                                LEGAL NOTICE                                *
 *                                                                            *
 *  USE OF THIS SOFTWARE (including any copy or compiled version thereof) AND *
 *  DOCUMENTATION IS SUBJECT TO THE SOFTWARE LICENSE AND RESTRICTIONS AND THE *
 *  WARRANTY DISLCAIMER SET FORTH IN LEGAL_NOTICE.TXT FILE. IF YOU DO NOT     *
 *  FULLY ACCEPT THE TERMS, YOU MAY NOT INSTALL OR OTHERWISE USE THE SOFTWARE *
 *  OR DOCUMENTATION.                                                         *
 *  NOTWITHSTANDING ANYTHING TO THE CONTRARY IN THIS NOTICE, INSTALLING OR    *
 *  OTHERISE USING THE SOFTWARE OR DOCUMENTATION INDICATES YOUR ACCEPTANCE OF *
 *  THE LICENSE TERMS AS STATED.                                              *
 *                                                                            *
 ******************************************************************************/
/* Version: 1.8.9\3686 */
/* Build  : 13 */
/* Date   : 12/08/2012 */

/**
	\file
	\brief Driver platform depended API
	\attention This file should not be modified.
		If you think something is wrong here, please contact CellGuide

*/

#ifndef _CGX_DRIVER_PLATFORM_H__
#define _CGX_DRIVER_PLATFORM_H__

#include "CgReturnCodes.h"
#include "CgxDriverApi.h"

/**
    Define the incoming data byte order
*/
extern const TCgByteOrder CGX_DRIVER_NATIVE_BYTE_ORDER;

/**
    Return the interrupt code for DMA interrupt
	\if OS_LINUX
		On Linux, request_irq uses this value to register the specified interrupt handler
	\endif
	\if OS_ANDROID
		On Android, request_irq uses this value to register the specified interrupt handler
	\endif
    \return interrupt code
	\retval 0	Don't use interrupt
*/
U32 CgxDriverDataReadyInterruptCode(void);



/**
	 0 means no IRQ code

    \return IRQ # of DMA
*/
U32 CgxDriverDataReadyIrqCode(void);



/**
    Return the interrupt code for CGsnap interrupt
	\if OS_LINUX
		On Linux, request_irq uses this value to register the specified interrupt handler
	\endif
	\if OS_ANDROID
		On Android, request_irq uses this value to register the specified interrupt handler
	\endif
    \return interrupt code
	\retval 0	Don't use interrupt
*/
U32 CgxDriverGpsInterruptCode(void);



/**
	 0 means no IRQ code

    \return IRQ # of GPS
*/
U32 CgxDriverGpsIrqCode(void);



/**
	Configure Data Ready (DMA) interrupt pin & directions
    this function is called once, on driver startup (\ref CgxDriverConstruct)

	\return System wide return code
	\retval ECgOk Success
*/
TCgReturnCode CgxDriverDmaInterruptPrepare(void);



/**
	Initial setup for CGsnap interrupt
    this function is called once, on driver startup (\ref CgxDriverConstruct)

	\return System wide return code
	\retval ECgOk Success
*/
TCgReturnCode CgxDriverGpsInterruptPrepare(void);




/**
    Return GPIO code for specific control line(for debug only)

    \param[in]		aPinNumber	GPIO code (CellGuide format)
	\param[out]		aGpioCode	Pointer to returned value

	\return System wide return code
	\retval ECgOk Success
*/
TCgReturnCode CgxDriverGpioCode(int aPinNumber, int *aGpioCode);


TCgReturnCode  CGxDriverGpsInterruptDone(U32 aIntCode);
TCgReturnCode  CGxDriverDataReadyInterruptDone(U32 aIntCode);



/**
    Enable/Disable TCXO power

    \param[in]		aEnable		1 = Enable TCXO, 0 =Disable TCXO

	\note If required, use platform.h to define specific device pins,
		  and keep the actual function generic.

	\return System wide return code
	\retval ECgOk Success
*/
TCgReturnCode CgxDriverTcxoEnable(U32 aEnable);

#endif /* _CGX_DRIVER_PLATFORM_H__ */