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 { UPIO_BT_WAKE = 0, UPIO_HOST_WAKE, UPIO_LPM_MODE, UPIO_MAX_COUNT }; 39 40 /* UPIO assertion/deassertion */ 41 enum { UPIO_UNKNOWN = 0, UPIO_DEASSERT, UPIO_ASSERT }; 42 43 /****************************************************************************** 44 ** Extern variables and functions 45 ******************************************************************************/ 46 47 /****************************************************************************** 48 ** Functions 49 ******************************************************************************/ 50 51 /******************************************************************************* 52 ** 53 ** Function upio_init 54 ** 55 ** Description Initialization 56 ** 57 ** Returns None 58 ** 59 *******************************************************************************/ 60 void upio_init(void); 61 62 /******************************************************************************* 63 ** 64 ** Function upio_cleanup 65 ** 66 ** Description Clean up 67 ** 68 ** Returns None 69 ** 70 *******************************************************************************/ 71 void upio_cleanup(void); 72 73 /******************************************************************************* 74 ** 75 ** Function upio_set_bluetooth_power 76 ** 77 ** Description Interact with low layer driver to set Bluetooth power 78 ** on/off. 79 ** 80 ** Returns 0 : SUCCESS or Not-Applicable 81 ** <0 : ERROR 82 ** 83 *******************************************************************************/ 84 int upio_set_bluetooth_power(int on); 85 86 /******************************************************************************* 87 ** 88 ** Function upio_set 89 ** 90 ** Description Set i/o based on polarity 91 ** 92 ** Returns None 93 ** 94 *******************************************************************************/ 95 void upio_set(uint8_t pio, uint8_t action, uint8_t polarity); 96 97 /******************************************************************************* 98 ** 99 ** Function bt_wake_up_host_mode_set 100 ** 101 ** Description To enable/disable bt_wake_up_host mode. 102 ** 103 ** Returns 0 : SUCCESS or Not-Applicable 104 ** <0 : ERROR 105 ** 106 *******************************************************************************/ 107 int bt_wake_up_host_mode_set(uint8_t mode); 108 #endif /* UPIO_H */ 109