• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2009-2018 Realtek 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 #include "bt_vendor_lib.h"
30 /******************************************************************************
31 **  Constants & Macros
32 ******************************************************************************/
33 
34 #define UPIO_BT_POWER_OFF 0
35 #define UPIO_BT_POWER_ON 1
36 
37 /* UPIO signals */
38 enum
39 {
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 {
49     UPIO_UNKNOWN = 0,
50     UPIO_DEASSERT,
51     UPIO_ASSERT
52 };
53 
54 /******************************************************************************
55 **  Extern variables and functions
56 ******************************************************************************/
57 
58 /******************************************************************************
59 **  Functions
60 ******************************************************************************/
61 
62 /*******************************************************************************
63 **
64 ** Function        upio_init
65 **
66 ** Description     Initialization
67 **
68 ** Returns         None
69 **
70 *******************************************************************************/
71 void upio_init(void);
72 
73 /*******************************************************************************
74 **
75 ** Function        upio_cleanup
76 **
77 ** Description     Clean up
78 **
79 ** Returns         None
80 **
81 *******************************************************************************/
82 void upio_cleanup(void);
83 
84 /*******************************************************************************
85 **
86 ** Function        upio_set_bluetooth_power
87 **
88 ** Description     Interact with low layer driver to set Bluetooth power
89 **                 on/off.
90 **
91 ** Returns         0  : SUCCESS or Not-Applicable
92 **                 <0 : ERROR
93 **
94 *******************************************************************************/
95 int upio_set_bluetooth_power(int on);
96 
97 /*******************************************************************************
98 **
99 ** Function        upio_set
100 **
101 ** Description     Set i/o based on polarity
102 **
103 ** Returns         None
104 **
105 *******************************************************************************/
106 void upio_set(uint8_t pio, uint8_t action, uint8_t polarity);
107 
108 /*******************************************************************************
109 **
110 ** Function        bt_wake_up_host_mode_set
111 **
112 ** Description     To enable/disable bt_wake_up_host mode.
113 **
114 ** Returns         0  : SUCCESS or Not-Applicable
115 **                 <0 : ERROR
116 **
117 *******************************************************************************/
118 int bt_wake_up_host_mode_set(uint8_t mode);
119 #endif /* UPIO_H */
120