Skip to content

Commit 1e8010d

Browse files
paul-szczepanek-arm0xc0170
authored andcommitted
cordi link layer 19.02 sources added
1 parent b34057f commit 1e8010d

File tree

298 files changed

+28832
-10205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+28832
-10205
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md

Lines changed: 543 additions & 0 deletions
Large diffs are not rendered by default.

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h

Lines changed: 28 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
/* Copyright (c) 2009-2019 Arm Limited
2-
* SPDX-License-Identifier: Apache-2.0
1+
/*************************************************************************************************/
2+
/*!
3+
* \file
34
*
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.
76
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved.
8+
* ARM Ltd. confidential and proprietary.
99
*
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.
2021
*/
2122
/*************************************************************************************************/
2223

@@ -312,33 +313,6 @@ uint16_t BbBleInitResolvingList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t
312313
/*************************************************************************************************/
313314
uint16_t BbBleInitPeriodicList(uint8_t numEntries, uint8_t *pFreeMem, uint32_t freeMemSize);
314315

315-
/*************************************************************************************************/
316-
/*!
317-
* \brief Get transmit RF path compensation.
318-
*
319-
* \return Transmit RF path compensation (in 1-dBm units).
320-
*/
321-
/*************************************************************************************************/
322-
int8_t BbBleRfGetTxRfPathComp(void);
323-
324-
/*************************************************************************************************/
325-
/*!
326-
* \brief Get receive RF path compensation.
327-
*
328-
* \return Transmit RF path compensation (in 1-dBm units).
329-
*/
330-
/*************************************************************************************************/
331-
int8_t BbBleRfGetRxRfPathComp(void);
332-
333-
/*************************************************************************************************/
334-
/*!
335-
* \brief Initialize RF path compensation.
336-
*
337-
* \return None.
338-
*/
339-
/*************************************************************************************************/
340-
void BbBleInitRfPathComp(void);
341-
342316
/*************************************************************************************************/
343317
/*!
344318
* \brief Get advertising packet statistics.
@@ -429,54 +403,36 @@ void BbBleGetPduFiltStats(BbBlePduFiltStats_t *pStats);
429403

430404
/*************************************************************************************************/
431405
/*!
432-
* \brief Get supported transmit power.
433-
*
434-
* \param pMinTxPwr Return buffer for minimum transmit power (expressed in 1dBm units).
435-
* \param pMaxTxPwr Return buffer for maximum transmit power (expressed in 1dBm units).
406+
* \brief Initialize for connected isochronous stream master operations.
436407
*
437408
* \return None.
438-
*/
439-
/*************************************************************************************************/
440-
void BbBleRfGetSupTxPower(int8_t *pMinTxPwr, int8_t *pMaxTxPwr);
441-
442-
/*************************************************************************************************/
443-
/*!
444-
* \brief Read RF path compensation.
445-
*
446-
* \param pTxPathComp Return buffer for RF transmit path compensation value (expressed in 0.1dBm units).
447-
* \param pRxPathComp Return buffer for RF receive path compensation value (expressed in 0.1dBm units).
448409
*
449-
* \return None.
410+
* Update the operation table with CIS master operations routines.
450411
*/
451412
/*************************************************************************************************/
452-
void BbBleRfReadRfPathComp(int16_t *pTxPathComp, int16_t *pRxPathComp);
413+
void BbBleCisMasterInit(void);
453414

454415
/*************************************************************************************************/
455416
/*!
456-
* \brief Set RF path compensation.
417+
* \brief Initialize for connected isochronous stream slave operations.
457418
*
458-
* \param txPathComp RF transmit path compensation value (expressed in 0.1dBm units).
459-
* \param rxPathComp RF receive path compensation value (expressed in 0.1dBm units).
419+
* \return None.
460420
*
461-
* \return TRUE if successful, FALSE otherwise.
421+
* Update the operation table with CIS slave operations routines.
462422
*/
463423
/*************************************************************************************************/
464-
bool_t BbBleRfWriteRfPathComp(int16_t txPathComp, int16_t rxPathComp);
424+
void BbBleCisSlaveInit(void);
465425

466426
/*************************************************************************************************/
467427
/*!
468-
* \brief Get the actual Tx power at the antenna (expressed in 1dBm units).
428+
* \brief Get CIS packet statistics.
469429
*
470-
* \param txPwr Tx power provided by the host (expressed in 1dBm units).
471-
* \param compFlag Flag to apply Tx path compensation or not.
430+
* \param pStats CIS data statistics.
472431
*
473-
* \return Actual Tx power at the antenna (expressed in 1dBm units).
474-
*
475-
* Tx path compensation is only used for extended ADV header.
476-
* Compensation is not considered when filling in HCI events.
432+
* \return None.
477433
*/
478434
/*************************************************************************************************/
479-
int8_t BbBleRfGetActualTxPower(int8_t txPwr, bool_t compFlag);
435+
void BbBleGetCisStats(BbBleDataPktStats_t *pStats);
480436

481437
/*! \} */ /* BB_API_BLE */
482438

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h

Lines changed: 111 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
/* Copyright (c) 2009-2019 Arm Limited
2-
* SPDX-License-Identifier: Apache-2.0
1+
/*************************************************************************************************/
2+
/*!
3+
* \file
34
*
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.
76
*
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.
99
*
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.
2021
*/
2122
/*************************************************************************************************/
2223

2324
#ifndef BB_BLE_API_OP_H
2425
#define BB_BLE_API_OP_H
2526

2627
#include "bb_api.h"
27-
#include "bb_ble_drv.h"
28+
#include "pal_bb_ble.h"
2829
#include "bb_ble_api_pdufilt.h"
2930
#include "ll_defs.h"
3031

@@ -62,12 +63,20 @@ enum
6263
BB_BLE_OP_SLV_AUX_ADV_EVENT, /*!< Slave auxiliary advertising event. */
6364
BB_BLE_OP_SLV_PER_ADV_EVENT, /*!< Slave periodic advertising event. */
6465
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. */
6568
BB_BLE_OP_NUM /*!< Total number of operations. */
6669
};
6770

6871
/*! \brief Maximum request PDU length (MAX(LL_SCAN_REQ_PDU_LEN, LL_CONN_IND_PDU_LEN)). */
6972
#define BB_REQ_PDU_MAX_LEN (LL_ADV_HDR_LEN + LL_CONN_IND_PDU_LEN)
7073

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+
7180
/**************************************************************************************************
7281
Data Types
7382
**************************************************************************************************/
@@ -105,6 +114,15 @@ typedef void (*BbBleTxDataComp_t)(BbOpDesc_t *pBod, uint8_t status);
105114
/*! \brief Data receive completion callback signature. */
106115
typedef void (*BbBleRxDataComp_t)(BbOpDesc_t *pBod, uint8_t *pBuf, uint8_t status);
107116

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+
108126
/*! \brief Test completion callback signature. */
109127
typedef bool_t (*BbBleTestComp_t)(BbOpDesc_t *pBod, uint8_t status);
110128

@@ -164,6 +182,8 @@ typedef struct
164182
uint8_t txAdvLen; /*!< Advertising buffer length. */
165183
uint8_t txRspLen; /*!< Scan response buffer length. */
166184

185+
uint8_t firstAdvChIdx; /*!< first advertising channel index. */
186+
167187
uint8_t advChMap; /*!< Advertising channel map. */
168188

169189
/* Return parameters. */
@@ -219,10 +239,10 @@ typedef struct
219239
typedef struct
220240
{
221241
/* 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. */
223243
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. */
226246

227247
BbBleAdvComp_t rxAuxReqCback; /*!< Auxiliary request receive completion callback. */
228248
BbBleAdvPost_t rxAuxReqPostCback; /*!< Auxiliary scan/connect request receive post processing callback. */
@@ -266,6 +286,39 @@ typedef struct
266286
uint8_t rxPhyOptions; /*!< Rx PHY options. */
267287
} BbBleSlvConnEvent_t;
268288

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+
269322
/*! \brief Continuous transmit operation data (\ref BB_BLE_OP_TEST_TX). */
270323
typedef struct
271324
{
@@ -289,7 +342,7 @@ typedef struct
289342
/*! \brief Bluetooth Low Energy protocol specific operation parameters. */
290343
typedef struct BbBleData_tag
291344
{
292-
BbBleDrvChan_t chan; /*!< Channelization parameters. */
345+
PalBbBleChan_t chan; /*!< Channelization parameters. */
293346
bbBlePduFiltParams_t pduFilt; /*!< PDU filter parameters. */
294347

295348
union
@@ -300,8 +353,10 @@ typedef struct BbBleData_tag
300353
BbBleSlvAuxAdvEvent_t slvAuxAdv; /*!< Slave auxiliary advertising event data. */
301354
BbBleSlvAuxAdvEvent_t slvPerAdv; /*!< Slave periodic advertising event data. */
302355
BbBleMstConnEvent_t mstConn; /*!< Master connection event data. */
303-
BbBleMstPerScanEvent_t mstPerScan; /*!< Master periodic scanning event data. */
304356
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. */
305360
BbBleTestTx_t testTx; /*!< Transmit test data. */
306361
BbBleTestRx_t testRx; /*!< Receive test data. */
307362
} op; /*!< Operation specific data. */
@@ -324,7 +379,7 @@ typedef struct BbBleData_tag
324379
* \ref BbBleSlvConnEvent_t::rxDataCback callback routine.
325380
*/
326381
/*************************************************************************************************/
327-
void BbBleTxData(BbBleDrvTxBufDesc_t descs[], uint8_t cnt);
382+
void BbBleTxData(PalBbBleTxBufDesc_t descs[], uint8_t cnt);
328383

329384
/*************************************************************************************************/
330385
/*!
@@ -344,6 +399,39 @@ void BbBleTxData(BbBleDrvTxBufDesc_t descs[], uint8_t cnt);
344399
/*************************************************************************************************/
345400
void BbBleRxData(uint8_t *pBuf, uint16_t len);
346401

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);
347435
/*! \} */ /* BB_API_BLE */
348436

349437
#ifdef __cplusplus

0 commit comments

Comments
 (0)