Skip to content

Commit 1bbadde

Browse files
paul-szczepanek-arm0xc0170
authored andcommitted
configs in mbed json
1 parent a6f639b commit 1bbadde

File tree

3 files changed

+143
-56
lines changed

3 files changed

+143
-56
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "cordio-ll-nrf52840",
3+
"config": {
4+
"phy-coded-support": {
5+
"help": "Coded PHY supported.",
6+
"value": 1
7+
},
8+
"extended-advertising-size": {
9+
"help": "Maximum extended advertising data (and scan data response) size",
10+
"value": 1650
11+
},
12+
"max-acl-size": {
13+
"help": "Maximum ACL buffer size",
14+
"value": 512
15+
},
16+
"tx-buffers": {
17+
"help": "Default number of send buffers",
18+
"value": 16
19+
}
20+
}
21+
}

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/mbed_lib.json

+40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
{
22
"name": "cordio-ll",
33
"config": {
4+
"max-advertising-sets": {
5+
"help": "Maximum number of advertising sets.",
6+
"value": 4
7+
},
8+
"max-advertising-reports": {
9+
"help": "Maximum number of pending legacy or extended advertising reports.",
10+
"value": 8
11+
},
12+
"default-extended-advertising-framentation-size": {
13+
"help": "Default extended advertising data fragmentation size.",
14+
"value": 64
15+
},
16+
"max-scan-request-events": {
17+
"help": "Maximum scan request received events.",
18+
"value": 4
19+
},
20+
"phy-2m-support": {
21+
"help": "2M PHY supported.",
22+
"value": 1
23+
},
24+
"rx-buffers": {
25+
"help": "Default number of receive buffers.",
26+
"value": 8
27+
},
28+
"phy-coded-support": {
29+
"help": "Coded PHY supported.",
30+
"value": 0
31+
},
32+
"extended-advertising-size": {
33+
"help": "Maximum extended advertising data (and scan data response) size",
34+
"value": 128
35+
},
36+
"max-acl-size": {
37+
"help": "Maximum ACL buffer size",
38+
"value": 256
39+
},
40+
"tx-buffers": {
41+
"help": "Default number of send buffers",
42+
"value": 8
43+
},
444
"handle-vendor-specific-hci-commands": {
545
"help": "Handle VS HCI commands. Valid values are 0 (ignore) and 1 (handle).",
646
"value": 0,

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp

+82-56
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,22 @@ using namespace ble::vendor::cordio;
5757

5858
/*! \brief Memory that should be reserved for the stack. */
5959
#if defined(NRF52840_XXAA)
60+
61+
#undef MBED_CONF_CORDIO_LL_EXTENDED_ADVERTISING_SIZE
62+
#undef MBED_CONF_CORDIO_LL_MAX_ACL_SIZE
63+
#undef MBED_CONF_CORDIO_LL_TX_BUFFERS
64+
#undef MBED_CONF_CORDIO_LL_PHY_CODED_SUPPORT
65+
#define MBED_CONF_CORDIO_LL_EXTENDED_ADVERTISING_SIZE MBED_CONF_CORDIO_LL_NRF52840_EXTENDED_ADVERTISING_SIZE
66+
#define MBED_CONF_CORDIO_LL_MAX_ACL_SIZE MBED_CONF_CORDIO_LL_NRF52840_MAX_ACL_SIZE
67+
#define MBED_CONF_CORDIO_LL_TX_BUFFERS MBED_CONF_CORDIO_LL_NRF52840_TX_BUFFERS
68+
#define MBED_CONF_CORDIO_LL_PHY_CODED_SUPPORT MBED_CONF_CORDIO_LL_NRF52840_PHY_CODED_SUPPORT
69+
6070
#define CORDIO_LL_MEMORY_FOOTPRINT 41906UL
71+
6172
#else
73+
6274
#define CORDIO_LL_MEMORY_FOOTPRINT 12768UL
75+
6376
#endif
6477

6578
/*! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
@@ -76,74 +89,87 @@ const BbRtCfg_t NRFCordioHCIDriver::_bb_cfg = {
7689
/*schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US
7790
};
7891

79-
static const uint16_t maxAdvReports = 16;
80-
static const uint16_t numRxBufs = 8;
81-
#if !defined(NRF52840_XXAA)
82-
static const uint16_t advDataLen = 128;
83-
static const uint16_t connDataLen = 256;
84-
static const uint16_t numTxBufs = 8;
85-
#else
86-
static const uint16_t advDataLen = LL_MAX_ADV_DATA_LEN;
87-
static const uint16_t connDataLen = 512;
88-
static const uint16_t numTxBufs = 16;
89-
#endif
90-
91-
9292
/* +12 for message headroom, + 2 event header, +255 maximum parameter length. */
9393
static const uint16_t maxRptBufSize = 12 + 2 + 255;
9494

9595
/* +12 for message headroom, +4 for header. */
96-
static const uint16_t aclBufSize = 12 + connDataLen + 4 + BB_DATA_PDU_TAILROOM;
96+
static const uint16_t aclBufSize = 12 + MBED_CONF_CORDIO_LL_MAX_ACL_SIZE + 4 + BB_DATA_PDU_TAILROOM;
9797

9898
const LlRtCfg_t NRFCordioHCIDriver::_ll_cfg = {
9999
/* Device */
100-
/*uint16_t*/ .compId = LL_COMP_ID_ARM, /*!< Company ID (default to ARM Ltd. ID). */
101-
/*uint16_t*/ .implRev = LL_IMPL_REV, /*!< Implementation revision number. */
102-
/*uint8_t*/ .btVer = LL_VER_BT_CORE_SPEC_5_0, /*!< Core specification implementation level (LL_VER_BT_CORE_SPEC_4_2). */
103-
/*uint32_t*/ ._align32 = 0, /*!< Unused. Align next field to word boundary. */
100+
/** Company ID (default to ARM Ltd. ID). */
101+
/*uint16_t*/ .compId = LL_COMP_ID_ARM,
102+
/** Implementation revision number. */
103+
/*uint16_t*/ .implRev = LL_IMPL_REV,
104+
/** Core specification implementation level (LL_VER_BT_CORE_SPEC_4_2). */
105+
/*uint8_t*/ .btVer = LL_VER_BT_CORE_SPEC_5_0,
106+
/** Unused. Align next field to word boundary. */
107+
/*uint32_t*/ ._align32 = 0,
108+
104109
/* Advertiser */
105-
/*uint8_t*/ .maxAdvSets = 4, /*!< Maximum number of advertising sets. */
106-
/*uint8_t*/ .maxAdvReports = 8, /*!< Maximum number of pending legacy or extended advertising reports. */
107-
/*uint16_t*/ .maxExtAdvDataLen = advDataLen, /*!< Maximum extended advertising data size. */
108-
/*uint8_t*/ .defExtAdvDataFrag = 64, /*!< Default extended advertising data fragmentation size. */
109-
/*uint16_t*/ .auxDelayUsec = 0, /*!< Auxiliary Offset delay above T_MAFS in microseconds. */
110-
/*uint16_t*/ .auxPtrOffsetUsec = 0, /*!< Delay of auxiliary packet in microseconds from the time specified by auxPtr. */
111-
/* Scanner */
112-
/*uint8_t*/ .maxScanReqRcvdEvt = 4, /*!< Maximum scan request received events. */
113-
/*uint16_t*/ .maxExtScanDataLen = advDataLen, /*!< Maximum extended scan data size. */
110+
/** Maximum number of advertising sets. */
111+
/*uint8_t*/ .maxAdvSets = MBED_CONF_CORDIO_LL_MAX_ADVERTISING_SETS,
112+
/** Maximum number of pending legacy or extended advertising reports. */
113+
/*uint8_t*/ .maxAdvReports = MBED_CONF_CORDIO_LL_MAX_ADVERTISING_REPORTS,
114+
/** Maximum extended advertising data size. */
115+
/*uint16_t*/ .maxExtAdvDataLen = MBED_CONF_CORDIO_LL_EXTENDED_ADVERTISING_SIZE,
116+
/** Default extended advertising data fragmentation size. */
117+
/*uint8_t*/ .defExtAdvDataFrag = MBED_CONF_CORDIO_LL_DEFAULT_EXTENDED_ADVERTISING_FRAMENTATION_SIZE,
118+
/** Auxiliary Offset delay above T_MAFS in microseconds. */
119+
/*uint16_t*/ .auxDelayUsec = 0,
120+
/** Delay of auxiliary packet in microseconds from the time specified by auxPtr. */
121+
/*uint16_t*/ .auxPtrOffsetUsec = 0,
122+
123+
/* Scanner */,
124+
/** Maximum scan request received events. */
125+
/*uint8_t*/ .maxScanReqRcvdEvt = MBED_CONF_CORDIO_LL_MAX_SCAN_REQUEST_EVENTS,
126+
/** Maximum extended scan data size. */
127+
/*uint16_t*/ .maxExtScanDataLen = MBED_CONF_CORDIO_LL_EXTENDED_ADVERTISING_SIZE,
128+
114129
/* Connection */
115-
#if defined(NRF52840_XXAA)
116-
/*uint8_t*/ .maxConn = 4, /*!< Maximum number of connections. */
117-
#else
118-
/*uint8_t*/ .maxConn = 2,
119-
#endif
120-
/*uint8_t*/ .numTxBufs = numTxBufs, /*!< Default number of transmit buffers. */
121-
/*uint8_t*/ .numRxBufs = numRxBufs, /*!< Default number of receive buffers. */
122-
/*uint16_t*/ .maxAclLen = connDataLen, /*!< Maximum ACL buffer size. */
123-
/*int8_t*/ .defTxPwrLvl = 0, /*!< Default Tx power level for connections. */
124-
/*uint8_t*/ .ceJitterUsec = 0, /*!< Allowable CE jitter on a slave (account for master's sleep clock resolution). */
130+
/** Maximum number of connections. */
131+
/*uint8_t*/ .maxConn = DM_CONN_MAX,
132+
/** Default number of transmit buffers. */
133+
/*uint8_t*/ .numTxBufs = MBED_CONF_CORDIO_LL_TX_BUFFERS,
134+
/** Default number of receive buffers. */
135+
/*uint8_t*/ .numRxBufs = MBED_CONF_CORDIO_LL_RX_BUFFERS,
136+
/** Maximum ACL buffer size. */
137+
/*uint16_t*/ .maxAclLen = MBED_CONF_CORDIO_LL_MAX_ACL_SIZE,
138+
/** Default Tx power level for connections. */
139+
/*int8_t*/ .defTxPwrLvl = 0,
140+
/** Allowable CE jitter on a slave (account for master's sleep clock resolution). */
141+
/*uint8_t*/ .ceJitterUsec = 0,
142+
125143
/* ISO */
126-
/*uint8_t*/ .numIsoTxBuf = 0, /*!< Default number of ISO transmit buffers. */
127-
/*uint8_t*/ .numIsoRxBuf = 0, /*!< Default number of ISO receive buffers. */
128-
/*uint16_t*/ .maxIsoBufLen = 0, /*!< Maximum ISO buffer size between host and controller. */
129-
/*uint16_t*/ .maxIsoPduLen = 0, /*!< Maximum ISO PDU buffer size. */
144+
/** Default number of ISO transmit buffers. */
145+
/*uint8_t*/ .numIsoTxBuf = 0,
146+
/** Default number of ISO receive buffers. */
147+
/*uint8_t*/ .numIsoRxBuf = 0,
148+
/** Maximum ISO buffer size between host and controller. */
149+
/*uint16_t*/ .maxIsoBufLen = 0,
150+
/** Maximum ISO PDU buffer size. */
151+
/*uint16_t*/ .maxIsoPduLen = 0,
130152

131153
/* CIS */
132-
/*uint8_t*/ .maxCig = 0, /*!< Maximum number of CIG. */
133-
/*uint8_t*/ .maxCis = 0, /*!< Maximum number of CIS. */
134-
/*uint16_t*/ .subEvtSpaceDelay = 0, /*!< Subevent spacing above T_MSS. */
154+
/** Maximum number of CIG. */
155+
/*uint8_t*/ .maxCig = 0,
156+
/** Maximum number of CIS. */
157+
/*uint8_t*/ .maxCis = 0,
158+
/** Subevent spacing above T_MSS. */
159+
/*uint16_t*/ .subEvtSpaceDelay = 0,
135160
/* DTM */
136-
/*uint16_t*/ .dtmRxSyncMs = 10000, /*!< DTM Rx synchronization window in milliseconds. */
137-
/* PHY */
138-
/*bool_t*/ .phy2mSup = TRUE, /*!< 2M PHY supported. */
161+
/** DTM Rx synchronization window in milliseconds. */
162+
/*uint16_t*/ .dtmRxSyncMs = 10000,
139163

140-
#if defined(NRF52840_XXAA)
141-
/*bool_t*/ .phyCodedSup = TRUE, /*!< Coded PHY supported. */
142-
#else
143-
/*bool_t*/ .phyCodedSup = FALSE,
144-
#endif
145-
/*bool_t*/ .stableModIdxTxSup = TRUE, /*!< Tx stable modulation index supported. */
146-
/*bool_t*/ .stableModIdxRxSup = TRUE, /*!< Rx stable modulation index supported. */
164+
/* PHY */
165+
/** 2M PHY supported. */
166+
/*bool_t*/ .phy2mSup = MBED_CONF_CORDIO_LL_PHY_2M_SUPPORT,
167+
/** Coded PHY supported. */
168+
/*bool_t*/ .phyCodedSup = MBED_CONF_CORDIO_LL_PHY_CODED_SUPPORT,
169+
/** Tx stable modulation index supported. */
170+
/*bool_t*/ .stableModIdxTxSup = TRUE,
171+
/** Rx stable modulation index supported. */
172+
/*bool_t*/ .stableModIdxRxSup = TRUE,
147173
};
148174

149175
extern "C" void TIMER0_IRQHandler(void);
@@ -219,8 +245,8 @@ ble::vendor::cordio::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_descrip
219245
{ 16, 16 + 8},
220246
{ 32, 16 + 4 },
221247
{ 64, 8 },
222-
{ 128, 4 + maxAdvReports },
223-
{ aclBufSize, numTxBufs + numRxBufs },
248+
{ 128, 4 + MBED_CONF_CORDIO_LL_MAX_ADVERTISING_REPORTS },
249+
{ aclBufSize, MBED_CONF_CORDIO_LL_TX_BUFFERS + MBED_CONF_CORDIO_LL_RX_BUFFERS },
224250
{ 272, 1 }
225251
};
226252

0 commit comments

Comments
 (0)