0
|
1 |
/*
|
|
2 |
* TwIf.h
|
|
3 |
*
|
|
4 |
* Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
|
|
5 |
* All rights reserved.
|
|
6 |
*
|
|
7 |
* This program and the accompanying materials are made available under the
|
|
8 |
* terms of the Eclipse Public License v1.0 or BSD License which accompanies
|
|
9 |
* this distribution. The Eclipse Public License is available at
|
|
10 |
* http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.
|
|
11 |
*
|
|
12 |
* Redistribution and use in source and binary forms, with or without
|
|
13 |
* modification, are permitted provided that the following conditions
|
|
14 |
* are met:
|
|
15 |
*
|
|
16 |
* * Redistributions of source code must retain the above copyright
|
|
17 |
* notice, this list of conditions and the following disclaimer.
|
|
18 |
* * Redistributions in binary form must reproduce the above copyright
|
|
19 |
* notice, this list of conditions and the following disclaimer in
|
|
20 |
* the documentation and/or other materials provided with the
|
|
21 |
* distribution.
|
|
22 |
* * Neither the name Texas Instruments nor the names of its
|
|
23 |
* contributors may be used to endorse or promote products derived
|
|
24 |
* from this software without specific prior written permission.
|
|
25 |
*
|
|
26 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
27 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
28 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
29 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
30 |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
32 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
33 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
34 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
35 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37 |
*/
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
/** \file TwIf.h
|
|
42 |
* \brief TwIf module API definition
|
|
43 |
*
|
|
44 |
* \see TwIf.c
|
|
45 |
*/
|
|
46 |
|
|
47 |
#ifndef __TWIF_API_H__
|
|
48 |
#define __TWIF_API_H__
|
|
49 |
|
|
50 |
|
|
51 |
#include "Device.h"
|
|
52 |
#include "TxnDefs.h"
|
|
53 |
#include "BusDrv.h"
|
|
54 |
|
|
55 |
|
|
56 |
/************************************************************************
|
|
57 |
* Defines
|
|
58 |
************************************************************************/
|
|
59 |
|
|
60 |
|
|
61 |
/************************************************************************
|
|
62 |
* Macros
|
|
63 |
************************************************************************/
|
|
64 |
/*
|
|
65 |
* Defines a TNETWIF read/write field with padding.
|
|
66 |
* A low level driver may use this padding internally
|
|
67 |
*/
|
|
68 |
#define PADDING(field) \
|
|
69 |
TI_UINT8 padding [TNETWIF_READ_OFFSET_BYTES]; \
|
|
70 |
field;
|
|
71 |
|
|
72 |
|
|
73 |
/************************************************************************
|
|
74 |
* Types
|
|
75 |
************************************************************************/
|
|
76 |
|
|
77 |
typedef void (*TTwIfCallback)(TI_HANDLE hCb);
|
|
78 |
typedef void (*TRecoveryCb)(TI_HANDLE hCb);
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
/************************************************************************
|
|
83 |
* Functions
|
|
84 |
************************************************************************/
|
|
85 |
TI_HANDLE twIf_Create (TI_HANDLE hOs);
|
|
86 |
TI_STATUS twIf_Destroy (TI_HANDLE hTwIf);
|
|
87 |
void twIf_Init (TI_HANDLE hTwIf, TI_HANDLE hReport, TI_HANDLE hContext, TI_HANDLE hTxnQ, TRecoveryCb fRecoveryCb, TI_HANDLE hRecoveryCb);
|
|
88 |
void twIf_RegisterErrCb (TI_HANDLE hTwIf, void *fErrCb, TI_HANDLE hErrCb);
|
|
89 |
ETxnStatus twIf_Restart (TI_HANDLE hTwIf);
|
|
90 |
void twIf_SetPartition (TI_HANDLE hTwIf,
|
|
91 |
TPartition *pPartition);
|
|
92 |
void twIf_Awake (TI_HANDLE hTwIf);
|
|
93 |
void twIf_Sleep (TI_HANDLE hTwIf);
|
|
94 |
void twIf_HwAvailable (TI_HANDLE hTwIf);
|
|
95 |
ETxnStatus twIf_Transact (TI_HANDLE hTwIf, TTxnStruct *pTxn);
|
|
96 |
ETxnStatus twIf_TransactReadFWStatus (TI_HANDLE hTwIf, TTxnStruct *pTxn);
|
|
97 |
|
|
98 |
TI_BOOL twIf_isValidMemoryAddr(TI_HANDLE hTwIf, TI_UINT32 Address, TI_UINT32 Length);
|
|
99 |
TI_BOOL twIf_isValidRegAddr(TI_HANDLE hTwIf, TI_UINT32 Address, TI_UINT32 Length);
|
|
100 |
|
|
101 |
#ifdef TI_DBG
|
|
102 |
void twIf_PrintModuleInfo (TI_HANDLE hTwIf);
|
|
103 |
void twIf_PrintQueues (TI_HANDLE hTwIf);
|
|
104 |
#endif /* TI_DBG */
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
#endif /*__TWIF_API_H__*/
|