4 * Description: Universal AMP API
6 * $Copyright Open Broadcom Corporation$
8 * $Id: uamp_api.h 294267 2011-11-04 23:41:52Z $
18 /*****************************************************************************
19 ** Constant and Type Definitions
20 ******************************************************************************
28 typedef uint16 UINT16;
31 /* UAMP identifiers */
34 typedef UINT8 tUAMP_ID;
36 /* UAMP event ids (used by UAMP_CBACK) */
37 #define UAMP_EVT_RX_READY 0 /* Data from AMP controller is ready to be read */
38 #define UAMP_EVT_CTLR_REMOVED 1 /* Controller removed */
39 #define UAMP_EVT_CTLR_READY 2 /* Controller added/ready */
40 typedef UINT8 tUAMP_EVT;
44 #define UAMP_CH_HCI_CMD 0 /* HCI Command channel */
45 #define UAMP_CH_HCI_EVT 1 /* HCI Event channel */
46 #define UAMP_CH_HCI_DATA 2 /* HCI ACL Data channel */
47 typedef UINT8 tUAMP_CH;
49 /* tUAMP_EVT_DATA: union for event-specific data, used by UAMP_CBACK */
51 tUAMP_CH channel; /* UAMP_EVT_RX_READY: channel for which rx occured */
55 /*****************************************************************************
57 ** Function: UAMP_CBACK
59 ** Description: Callback for events. Register callback using UAMP_Init.
61 ** Parameters amp_id: AMP device identifier that generated the event
63 ** p_amp_evt_data: pointer to event-specific data
65 ******************************************************************************
67 typedef void (*tUAMP_CBACK)(tUAMP_ID amp_id, tUAMP_EVT amp_evt, tUAMP_EVT_DATA *p_amp_evt_data);
69 /*****************************************************************************
70 ** external function declarations
71 ******************************************************************************
78 /*****************************************************************************
80 ** Function: UAMP_Init
82 ** Description: Initialize UAMP driver
84 ** Parameters p_cback: Callback function for UAMP event notification
86 ******************************************************************************
88 BT_API BOOLEAN UAMP_Init(tUAMP_CBACK p_cback);
91 /*****************************************************************************
93 ** Function: UAMP_Open
95 ** Description: Open connection to local AMP device.
97 ** Parameters app_id: Application specific AMP identifer. This value
98 ** will be included in AMP messages sent to the
99 ** BTU task, to identify source of the message
101 ******************************************************************************
103 BT_API BOOLEAN UAMP_Open(tUAMP_ID amp_id);
105 /*****************************************************************************
107 ** Function: UAMP_Close
109 ** Description: Close connection to local AMP device.
111 ** Parameters app_id: Application specific AMP identifer.
113 ******************************************************************************
115 BT_API void UAMP_Close(tUAMP_ID amp_id);
118 /*****************************************************************************
120 ** Function: UAMP_Write
122 ** Description: Send buffer to AMP device. Frees GKI buffer when done.
125 ** Parameters: app_id: AMP identifer.
126 ** p_buf: pointer to buffer to write
127 ** num_bytes: number of bytes to write
128 ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_CMD
130 ** Returns: number of bytes written
132 ******************************************************************************
134 BT_API UINT16 UAMP_Write(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 num_bytes, tUAMP_CH channel);
136 /*****************************************************************************
138 ** Function: UAMP_Read
140 ** Description: Read incoming data from AMP. Call after receiving a
141 ** UAMP_EVT_RX_READY callback event.
143 ** Parameters: app_id: AMP identifer.
144 ** p_buf: pointer to buffer for holding incoming AMP data
145 ** buf_size: size of p_buf
146 ** channel: UAMP_CH_HCI_ACL, or UAMP_CH_HCI_EVT
148 ** Returns: number of bytes read
150 ******************************************************************************
152 BT_API UINT16 UAMP_Read(tUAMP_ID amp_id, UINT8 *p_buf, UINT16 buf_size, tUAMP_CH channel);
158 #endif /* UAMP_API_H */