4 * Description: Universal AMP API
6 * Copyright (C) 1999-2016, Broadcom Corporation
8 * Unless you and Broadcom execute a separate written software license
9 * agreement governing use of this software, this software is licensed to you
10 * under the terms of the GNU General Public License version 2 (the "GPL"),
11 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
12 * following added to such license:
14 * As a special exception, the copyright holders of this software give you
15 * permission to link this software with independent modules, and to copy and
16 * distribute the resulting executable under terms of your choice, provided that
17 * you also meet, for each linked independent module, the terms and conditions of
18 * the license of that module. An independent module is a module which is not
19 * derived from this software. The special exception does not apply to any
20 * modifications of the software.
22 * Notwithstanding the above, under no circumstances may you combine this
23 * software in any way with any other Broadcom software provided under a license
24 * other than the GPL, without Broadcom's express prior written consent.
27 * <<Broadcom-WL-IPTag/Open:>>
29 * $Id: uamp_api.h 514727 2014-11-12 03:02:48Z $
41 /*****************************************************************************
42 ** Constant and Type Definitions
43 ******************************************************************************
51 typedef uint16 UINT16;
54 /* UAMP identifiers */
57 typedef UINT8 tUAMP_ID;
59 /* UAMP event ids (used by UAMP_CBACK) */
60 #define UAMP_EVT_RX_READY 0 /* Data from AMP controller is ready to be read */
61 #define UAMP_EVT_CTLR_REMOVED 1 /* Controller removed */
62 #define UAMP_EVT_CTLR_READY 2 /* Controller added/ready */
63 typedef UINT8 tUAMP_EVT;
67 #define UAMP_CH_HCI_CMD 0 /* HCI Command channel */
68 #define UAMP_CH_HCI_EVT 1 /* HCI Event channel */
69 #define UAMP_CH_HCI_DATA 2 /* HCI ACL Data channel */
70 typedef UINT8 tUAMP_CH;
72 /* tUAMP_EVT_DATA: union for event-specific data, used by UAMP_CBACK */
74 tUAMP_CH channel; /* UAMP_EVT_RX_READY: channel for which rx occured */
78 /*****************************************************************************
80 ** Function: UAMP_CBACK
82 ** Description: Callback for events. Register callback using UAMP_Init.
84 ** Parameters amp_id: AMP device identifier that generated the event
86 ** p_amp_evt_data: pointer to event-specific data
88 ******************************************************************************
90 typedef void (*tUAMP_CBACK)(tUAMP_ID amp_id, tUAMP_EVT amp_evt, tUAMP_EVT_DATA *p_amp_evt_data);
92 /*****************************************************************************
93 ** external function declarations
94 ******************************************************************************
101 /*****************************************************************************
103 ** Function: UAMP_Init
105 ** Description: Initialize UAMP driver
107 ** Parameters p_cback: Callback function for UAMP event notification
109 ******************************************************************************
111 BT_API BOOLEAN UAMP_Init(tUAMP_CBACK p_cback);
114 /*****************************************************************************
116 ** Function: UAMP_Open
118 ** Description: Open connection to local AMP device.
120 ** Parameters app_id: Application specific AMP identifer. This value
121 ** will be included in AMP messages sent to the
122 ** BTU task, to identify source of the message
124 ******************************************************************************
126 BT_API BOOLEAN UAMP_Open(tUAMP_ID amp_id);
128 /*****************************************************************************
130 ** Function: UAMP_Close
132 ** Description: Close connection to local AMP device.
134 ** Parameters app_id: Application specific AMP identifer.
136 ******************************************************************************
138 BT_API void UAMP_Close(tUAMP_ID amp_id);
141 /*****************************************************************************
143 ** Function: UAMP_Write
145 ** Description: Send buffer to AMP device. Frees GKI buffer when done.
148 ** Parameters: app_id: AMP identifer.
149 ** p_buf: pointer to buffer to write
150 ** num_bytes: number of bytes to write
151 ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_CMD
153 ** Returns: number of bytes written
155 ******************************************************************************
157 BT_API UINT16 UAMP_Write(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 num_bytes, tUAMP_CH channel);
159 /*****************************************************************************
161 ** Function: UAMP_Read
163 ** Description: Read incoming data from AMP. Call after receiving a
164 ** UAMP_EVT_RX_READY callback event.
166 ** Parameters: app_id: AMP identifer.
167 ** p_buf: pointer to buffer for holding incoming AMP data
168 ** buf_size: size of p_buf
169 ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_EVT
171 ** Returns: number of bytes read
173 ******************************************************************************
175 BT_API UINT16 UAMP_Read(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 buf_size, tUAMP_CH channel);
181 #endif /* UAMP_API_H */