• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2009-2012 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  Filename:      upio.h
22  *
23  *  Description:   Contains definitions used for I/O controls
24  *
25  ******************************************************************************/
26 
27 #ifndef UPIO_H
28 #define UPIO_H
29 
30 #include <stdint.h>
31 /******************************************************************************
32 **  Constants & Macros
33 ******************************************************************************/
34 
35 #define UPIO_BT_POWER_OFF 0
36 #define UPIO_BT_POWER_ON  1
37 
38 /* UPIO signals */
39 enum {
40     UPIO_BT_WAKE = 0,
41     UPIO_HOST_WAKE,
42     UPIO_LPM_MODE,
43     UPIO_MAX_COUNT
44 };
45 
46 /* UPIO assertion/deassertion */
47 enum {
48     UPIO_UNKNOWN = 0,
49     UPIO_DEASSERT,
50     UPIO_ASSERT
51 };
52 
53 /******************************************************************************
54 **  Extern variables and functions
55 ******************************************************************************/
56 
57 /******************************************************************************
58 **  Functions
59 ******************************************************************************/
60 
61 /*******************************************************************************
62 **
63 ** Function        upio_init
64 **
65 ** Description     Initialization
66 **
67 ** Returns         None
68 **
69 *******************************************************************************/
70 void upio_init(void);
71 
72 /*******************************************************************************
73 **
74 ** Function        upio_cleanup
75 **
76 ** Description     Clean up
77 **
78 ** Returns         None
79 **
80 *******************************************************************************/
81 void upio_cleanup(void);
82 
83 /*******************************************************************************
84 **
85 ** Function        upio_set_bluetooth_power
86 **
87 ** Description     Interact with low layer driver to set Bluetooth power
88 **                 on/off.
89 **
90 ** Returns         0  : SUCCESS or Not-Applicable
91 **                 <0 : ERROR
92 **
93 *******************************************************************************/
94 int upio_set_bluetooth_power(int on);
95 
96 /*******************************************************************************
97 **
98 ** Function        upio_set
99 **
100 ** Description     Set i/o based on polarity
101 **
102 ** Returns         None
103 **
104 *******************************************************************************/
105 void upio_set(uint8_t pio, uint8_t action, uint8_t polarity);
106 
107 #endif /* UPIO_H */
108 
109