@@ -57,9 +57,22 @@ using namespace ble::vendor::cordio;
57
57
58
58
/* ! \brief Memory that should be reserved for the stack. */
59
59
#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
+
60
70
#define CORDIO_LL_MEMORY_FOOTPRINT 41906UL
71
+
61
72
#else
73
+
62
74
#define CORDIO_LL_MEMORY_FOOTPRINT 12768UL
75
+
63
76
#endif
64
77
65
78
/* ! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
@@ -76,74 +89,87 @@ const BbRtCfg_t NRFCordioHCIDriver::_bb_cfg = {
76
89
/* schSetupDelayUsec*/ BB_SCH_SETUP_DELAY_US
77
90
};
78
91
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
-
92
92
/* +12 for message headroom, + 2 event header, +255 maximum parameter length. */
93
93
static const uint16_t maxRptBufSize = 12 + 2 + 255 ;
94
94
95
95
/* +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;
97
97
98
98
const LlRtCfg_t NRFCordioHCIDriver::_ll_cfg = {
99
99
/* 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
+
104
109
/* 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
+
114
129
/* 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
+
125
143
/* 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 ,
130
152
131
153
/* 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 ,
135
160
/* 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 ,
139
163
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 ,
147
173
};
148
174
149
175
extern " C" void TIMER0_IRQHandler (void );
@@ -219,8 +245,8 @@ ble::vendor::cordio::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_descrip
219
245
{ 16 , 16 + 8 },
220
246
{ 32 , 16 + 4 },
221
247
{ 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 },
224
250
{ 272 , 1 }
225
251
};
226
252
0 commit comments