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