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
|
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2014 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (??MStar Confidential Information??) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////
/**
*
* @file mstar_drv_utility_adaption.h
*
* @brief This file defines the interface of touch screen
*
*
*/
#ifndef __MSTAR_DRV_UTILITY_ADAPTION_H__
#define __MSTAR_DRV_UTILITY_ADAPTION_H__ (1)
////////////////////////////////////////////////////////////
/// Included Files
////////////////////////////////////////////////////////////
#include "mstar_drv_common.h"
////////////////////////////////////////////////////////////
/// Constant
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/// Data Types
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/// Variables
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
/// Macro
////////////////////////////////////////////////////////////
#define BK_REG8_WL(addr,val) ( RegSetLByteValue( addr, val ) )
#define BK_REG8_WH(addr,val) ( RegSetHByteValue( addr, val ) )
#define BK_REG16_W(addr,val) ( RegSet16BitValue( addr, val ) )
#define BK_REG8_RL(addr) ( RegGetLByteValue( addr ) )
#define BK_REG8_RH(addr) ( RegGetHByteValue( addr ) )
#define BK_REG16_R(addr) ( RegGet16BitValue( addr ) )
#define PRINTF_EMERG(fmt, ...) printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_ALERT(fmt, ...) printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_CRIT(fmt, ...) printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_ERR(fmt, ...) printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_WARN(fmt, ...) printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_NOTICE(fmt, ...) printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_INFO(fmt, ...) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_DEBUG(fmt, ...) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
////////////////////////////////////////////////////////////
/// Function Prototypes
////////////////////////////////////////////////////////////
#ifdef CONFIG_ENABLE_DMA_IIC
extern void DmaAlloc(void);
extern void DmaReset(void);
extern void DmaFree(void);
#endif //CONFIG_ENABLE_DMA_IIC
extern u16 RegGet16BitValue(u16 nAddr);
extern u8 RegGetLByteValue(u16 nAddr);
extern u8 RegGetHByteValue(u16 nAddr);
extern void RegGetXBitValue(u16 nAddr, u8 * pRxData, u16 nLength, u16 nMaxI2cLengthLimit);
extern void RegSet16BitValue(u16 nAddr, u16 nData);
extern void RegSetLByteValue(u16 nAddr, u8 nData);
extern void RegSetHByteValue(u16 nAddr, u8 nData);
extern void RegSet16BitValueOn(u16 nAddr, u16 nData);
extern void RegSet16BitValueOff(u16 nAddr, u16 nData);
extern u16 RegGet16BitValueByAddressMode(u16 nAddr, AddressMode_e eAddressMode);
extern void RegSet16BitValueByAddressMode(u16 nAddr, u16 nData, AddressMode_e eAddressMode);
extern void RegMask16BitValue(u16 nAddr, u16 nMask, u16 nData, AddressMode_e eAddressMode);
extern s32 DbBusEnterSerialDebugMode(void);
extern void DbBusExitSerialDebugMode(void);
extern void DbBusIICUseBus(void);
extern void DbBusIICNotUseBus(void);
extern void DbBusIICReshape(void);
extern void DbBusStopMCU(void);
extern void DbBusNotStopMCU(void);
extern void DbBusResetSlave(void);
extern void DbBusWaitMCU(void);
extern s32 IicWriteData(u8 nSlaveId, u8* pBuf, u16 nSize);
extern s32 IicReadData(u8 nSlaveId, u8* pBuf, u16 nSize);
extern s32 IicSegmentReadDataByDbBus(u8 nRegBank, u8 nRegAddr, u8* pBuf, u16 nSize, u16 nMaxI2cLengthLimit);
extern s32 IicSegmentReadDataBySmBus(u16 nAddr, u8* pBuf, u16 nSize, u16 nMaxI2cLengthLimit);
extern void mstpMemSet(void *pDst, s8 nVal, u32 nSize);
extern void mstpMemCopy(void *pDst, void *pSource, u32 nSize);
extern void mstpDelay(u32 nTime);
#endif // __MSTAR_DRV_UTILITY_ADAPTION_H__
|