1
- /* Copyright (c) 2009-2019 Arm Limited
2
- * SPDX-License-Identifier: Apache-2.0
1
+ /*************************************************************************************************/
2
+ /*!
3
+ * \file
3
4
*
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
5
+ * \brief BLE baseband interface file.
7
6
*
8
- * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Copyright (c) 2016-2019 Arm Ltd. All Rights Reserved.
8
+ * Arm Ltd. confidential and proprietary.
9
9
*
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- /*************************************************************************************************/
18
- /*!
19
- * \brief BLE baseband interface file.
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
20
21
*/
21
22
/*************************************************************************************************/
22
23
23
24
#ifndef BB_BLE_API_OP_H
24
25
#define BB_BLE_API_OP_H
25
26
26
27
#include "bb_api.h"
27
- #include "bb_ble_drv .h"
28
+ #include "pal_bb_ble .h"
28
29
#include "bb_ble_api_pdufilt.h"
29
30
#include "ll_defs.h"
30
31
62
63
BB_BLE_OP_SLV_AUX_ADV_EVENT , /*!< Slave auxiliary advertising event. */
63
64
BB_BLE_OP_SLV_PER_ADV_EVENT , /*!< Slave periodic advertising event. */
64
65
BB_BLE_OP_MST_PER_SCAN_EVENT , /*!< Master periodic scanning event. */
66
+ BB_BLE_OP_MST_CIS_EVENT , /*!< Master CIS event. */
67
+ BB_BLE_OP_SLV_CIS_EVENT , /*!< Slave CIS event. */
65
68
BB_BLE_OP_NUM /*!< Total number of operations. */
66
69
};
67
70
68
71
/*! \brief Maximum request PDU length (MAX(LL_SCAN_REQ_PDU_LEN, LL_CONN_IND_PDU_LEN)). */
69
72
#define BB_REQ_PDU_MAX_LEN (LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN)
70
73
74
+ /*! \brief Guard time at the end of a scan window to the next BOD. Backoff one advertise data exchange. */
75
+ #define BB_SCAN_GUARD_US (LL_ADV_PKT_MAX_USEC + LL_BLE_TIFS_US + \
76
+ LL_SCAN_REQ_MAX_USEC + LL_BLE_TIFS_US + \
77
+ LL_SCAN_RSP_MAX_USEC + \
78
+ BbGetSchSetupDelayUs())
79
+
71
80
/**************************************************************************************************
72
81
Data Types
73
82
**************************************************************************************************/
@@ -105,6 +114,15 @@ typedef void (*BbBleTxDataComp_t)(BbOpDesc_t *pBod, uint8_t status);
105
114
/*! \brief Data receive completion callback signature. */
106
115
typedef void (* BbBleRxDataComp_t )(BbOpDesc_t * pBod , uint8_t * pBuf , uint8_t status );
107
116
117
+ /*! \brief CIS check whether to continue current operation call signature. */
118
+ typedef uint32_t (* BbBleCisCheckContOp_t )(BbOpDesc_t * pBod , bool_t * pNewCisCtx );
119
+
120
+ /*! \brief CIS post execute callback signature. */
121
+ typedef void (* BbBleCisPostExec_t )(BbOpDesc_t * pBod , uint8_t status );
122
+
123
+ /*! \brief CIS data receive completion callback signature. */
124
+ typedef void (* BbBleCisRxDataComp_t )(BbOpDesc_t * pBod , uint8_t * pBuf , uint8_t status );
125
+
108
126
/*! \brief Test completion callback signature. */
109
127
typedef bool_t (* BbBleTestComp_t )(BbOpDesc_t * pBod , uint8_t status );
110
128
@@ -164,6 +182,8 @@ typedef struct
164
182
uint8_t txAdvLen ; /*!< Advertising buffer length. */
165
183
uint8_t txRspLen ; /*!< Scan response buffer length. */
166
184
185
+ uint8_t firstAdvChIdx ; /*!< first advertising channel index. */
186
+
167
187
uint8_t advChMap ; /*!< Advertising channel map. */
168
188
169
189
/* Return parameters. */
@@ -219,10 +239,10 @@ typedef struct
219
239
typedef struct
220
240
{
221
241
/* TODO BbBleSlvAuxAdvEvent_t hide buffer descriptors in BB layer. */
222
- BbBleDrvTxBufDesc_t txAuxAdvPdu [2 ]; /*!< Advertising PDU descriptor. */
242
+ PalBbBleTxBufDesc_t txAuxAdvPdu [2 ]; /*!< Advertising PDU descriptor. */
223
243
uint8_t * pRxAuxReqBuf ; /*!< Auxiliary request buffer (must be size of BB_REQ_PDU_MAX_LEN). */
224
- BbBleDrvTxBufDesc_t txAuxRspPdu [2 ]; /*!< Response PDU descriptor. */
225
- BbBleDrvTxBufDesc_t txAuxChainPdu [2 ]; /*!< Auxiliary chain PDU descriptor. */
244
+ PalBbBleTxBufDesc_t txAuxRspPdu [2 ]; /*!< Response PDU descriptor. */
245
+ PalBbBleTxBufDesc_t txAuxChainPdu [2 ]; /*!< Auxiliary chain PDU descriptor. */
226
246
227
247
BbBleAdvComp_t rxAuxReqCback ; /*!< Auxiliary request receive completion callback. */
228
248
BbBleAdvPost_t rxAuxReqPostCback ; /*!< Auxiliary scan/connect request receive post processing callback. */
@@ -266,6 +286,39 @@ typedef struct
266
286
uint8_t rxPhyOptions ; /*!< Rx PHY options. */
267
287
} BbBleSlvConnEvent_t ;
268
288
289
+ /*! \brief CIS master event operation data (\ref BB_BLE_OP_MST_CIS_EVENT). */
290
+ typedef struct
291
+ {
292
+ BbBleCisCheckContOp_t checkContOpCback ; /*!< Check whether to continue current operation callback. */
293
+ BbBleExec_t execCback ; /*!< Execute callback. */
294
+ BbBleExec_t contExecCback ; /*!< Continue execute callback. */
295
+ BbBleCisPostExec_t postSubEvtCback ; /*!< Post subevent callback. */
296
+ BbBleCancel_t cancelCback ; /*!< Cancel callback. */
297
+ BbBleTxDataComp_t txDataCback ; /*!< Transmit completion callback. */
298
+ BbBleCisRxDataComp_t rxDataCback ; /*!< Receive completion callback. */
299
+ /* Return parameters. */
300
+ int8_t rssi ; /*!< RSSI of the last received packet. */
301
+ uint8_t rxPhyOptions ; /*!< Rx PHY options. */
302
+ } BbBleMstCisEvent_t ;
303
+
304
+ /*! \brief CIS slave event operation data (\ref BB_BLE_OP_SLV_CIS_EVENT). */
305
+ typedef struct
306
+ {
307
+ BbBleCisCheckContOp_t checkContOpCback ; /*!< Check whether to continue current operation callback. */
308
+ BbBleExec_t execCback ; /*!< Execute callback. */
309
+ BbBleExec_t contExecCback ; /*!< Continue execute callback. */
310
+ BbBleCisPostExec_t postSubEvtCback ; /*!< Post subevent callback. */
311
+ BbBleCancel_t cancelCback ; /*!< Cancel callback. */
312
+ BbBleTxDataComp_t txDataCback ; /*!< Transmit completion callback. */
313
+ BbBleRxDataComp_t rxDataCback ; /*!< Receive completion callback. */
314
+
315
+ /* Return parameters. */
316
+ uint32_t startTs ; /*!< Start timestamp of the first received packet. */
317
+ int8_t rssi ; /*!< RSSI of the last received packet. */
318
+ uint8_t rxPhyOptions ; /*!< Rx PHY options. */
319
+ uint32_t rxSyncDelayUsec ; /*!< Receive timeout in microseconds. */
320
+ } BbBleSlvCisEvent_t ;
321
+
269
322
/*! \brief Continuous transmit operation data (\ref BB_BLE_OP_TEST_TX). */
270
323
typedef struct
271
324
{
@@ -289,7 +342,7 @@ typedef struct
289
342
/*! \brief Bluetooth Low Energy protocol specific operation parameters. */
290
343
typedef struct BbBleData_tag
291
344
{
292
- BbBleDrvChan_t chan ; /*!< Channelization parameters. */
345
+ PalBbBleChan_t chan ; /*!< Channelization parameters. */
293
346
bbBlePduFiltParams_t pduFilt ; /*!< PDU filter parameters. */
294
347
295
348
union
@@ -300,8 +353,10 @@ typedef struct BbBleData_tag
300
353
BbBleSlvAuxAdvEvent_t slvAuxAdv ; /*!< Slave auxiliary advertising event data. */
301
354
BbBleSlvAuxAdvEvent_t slvPerAdv ; /*!< Slave periodic advertising event data. */
302
355
BbBleMstConnEvent_t mstConn ; /*!< Master connection event data. */
303
- BbBleMstPerScanEvent_t mstPerScan ; /*!< Master periodic scanning event data. */
304
356
BbBleSlvConnEvent_t slvConn ; /*!< Slave connection event data. */
357
+ BbBleMstPerScanEvent_t mstPerScan ; /*!< Master periodic scanning event data. */
358
+ BbBleMstCisEvent_t mstCis ; /*!< Master CIS event data. */
359
+ BbBleSlvCisEvent_t slvCis ; /*!< Slave CIS event data. */
305
360
BbBleTestTx_t testTx ; /*!< Transmit test data. */
306
361
BbBleTestRx_t testRx ; /*!< Receive test data. */
307
362
} op ; /*!< Operation specific data. */
@@ -324,7 +379,7 @@ typedef struct BbBleData_tag
324
379
* \ref BbBleSlvConnEvent_t::rxDataCback callback routine.
325
380
*/
326
381
/*************************************************************************************************/
327
- void BbBleTxData (BbBleDrvTxBufDesc_t descs [], uint8_t cnt );
382
+ void BbBleTxData (PalBbBleTxBufDesc_t descs [], uint8_t cnt );
328
383
329
384
/*************************************************************************************************/
330
385
/*!
@@ -344,6 +399,39 @@ void BbBleTxData(BbBleDrvTxBufDesc_t descs[], uint8_t cnt);
344
399
/*************************************************************************************************/
345
400
void BbBleRxData (uint8_t * pBuf , uint16_t len );
346
401
402
+ /*************************************************************************************************/
403
+ /*!
404
+ * \brief Transmit CIS PDU at next transmit slot.
405
+ *
406
+ * \param descs Array of transmit buffer descriptor.
407
+ * \param cnt Number of descriptors.
408
+ *
409
+ * \return None.
410
+ *
411
+ * \note This function is expected to be called during the call context of
412
+ * \ref BbBleMstCisEvent_t::rxDataCback or \ref BbBleSlvCisEvent_t::rxDataCback
413
+ * callback routine.
414
+ */
415
+ /*************************************************************************************************/
416
+ void BbBleCisTxData (PalBbBleTxBufDesc_t descs [], uint8_t cnt );
417
+
418
+ /*************************************************************************************************/
419
+ /*!
420
+ * \brief Set receive data buffer for next receive slot.
421
+ *
422
+ * \param pBuf Receive data buffer.
423
+ * \param len Maximum length of data buffer.
424
+ *
425
+ * \return None.
426
+ *
427
+ * \note This function is expected to be called during the call context of
428
+ * \ref BbBleSlvCisEvent_t::rxDataCback callback routine.
429
+ *
430
+ * \note BB must always call the BbBleSlvCisEvent_t::rxDataCback callback routine of the
431
+ * currently executing BOD with the given buffer.
432
+ */
433
+ /*************************************************************************************************/
434
+ void BbBleCisRxData (uint8_t * pBuf , uint16_t len );
347
435
/*! \} */ /* BB_API_BLE */
348
436
349
437
#ifdef __cplusplus
0 commit comments