rflib
RFCC26X2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!****************************************************************************
33 @file RFCC26X2.h
34 @brief Radio Frequency (RF) Core Driver for the CC13X2 and CC26X2 device
35  family.
36 
37 To use the RF driver, ensure that the correct driver library for your device
38 is linked in and include the top-level header file as follows:
39 
40 @code
41 #include <ti/drivers/rf/RF.h>
42 @endcode
43 
44 <hr>
45 @anchor rf_overview
46 Overview
47 ========
48 
49 The RF driver provides access to the radio core on the CC13x2/CC26x2 device
50 family. It offers a high-level interface for command execution and to the
51 radio timer (RAT). The RF driver ensures the lowest possible power consumption
52 by providing automatic power management that is fully transparent for the
53 application.
54 
55 @note This document describes the features and usage of the RF driver API. For a
56 detailed explanation of the RF core, please refer to the
57 <a href='../../proprietary-rf/technical-reference-manual.html'><b>Technical
58 Reference Manual</b></a> or the
59 <a href='../../proprietary-rf/proprietary-rf-users-guide.html'><b>Proprietary
60 RF User Guide</b></a>.
61 
62 <b>Key features are:</b>
63 
64 @li @ref rf_command_execution "Synchronous execution of direct and immediate radio commands"
65 @li @ref rf_command_execution "Synchronous and asynchronous execution of radio operation commands"
66 @li Various @ref rf_event_callbacks "event hooks" to interact with RF commands and the RF driver
67 @li Automatic @ref rf_power_management "power management"
68 @li @ref rf_scheduling "Preemptive scheduler for RF operations" of different RF driver instances
69 @li Convenient @ref rf_rat "Access to the radio timer" (RAT)
70 @li @ref rf_tx_power "Programming the TX power level"
71 
72 @anchor rf_setup_and_configuration
73 Setup and configuration
74 =======================
75 
76 The RF driver can be configured at 4 different places:
77 
78 1. In the build configuration by choosing either the single-client or
79  multi-client driver version.
80 
81 2. At compile-time by setting hardware and software interrupt priorities
82  in the board support file.
83 
84 3. During run-time initialization by setting #RF_Params when calling
85  #RF_open().
86 
87 4. At run-time via #RF_control().
88 
89 
90 Build configuration
91 -------------------
92 
93 The RF driver comes in two versions: single-client and multi-client. The
94 single-client version allows only one driver instance to access the RF core at
95 a time. The multi-client driver version allows concurrent access to the RF
96 core with different RF settings. The multi-client driver has a slightly larger
97 footprint and is not needed for many proprietary applications. The driver
98 version can be selected in the build configuration by linking against a
99 RFCC26X2_multiMode pre-built library. The multi-client driver is the default
100 configuration in the SimpleLink SDKs.
101 
102 
103 Board configuration
104 -------------------
105 
106 The RF driver handles RF core hardware interrupts and uses software interrupts
107 for its internal state machine. For managing the interrupt priorities, it
108 expects the existence of a global #RFCC26XX_HWAttrsV2 object. This object is configured
109 in SysConfig and defined in the generated file `ti_drivers_config.c`.
110 By default, the priorities are set to the lowest possible value:
111 
112 @code
113 const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
114  .hwiPriority = INT_PRI_LEVEL7, // Lowest HWI priority: INT_PRI_LEVEL7
115  // Highest HWI priority: INT_PRI_LEVEL1
116 
117  .swiPriority = 0, // Lowest SWI priority: 0
118  // Highest SWI priority: Swi.numPriorities - 1
119 
120  .xoscHfAlwaysNeeded = true // Power driver always starts XOSC-HF: true
121  // RF driver will request XOSC-HF if needed: false
122 };
123 @endcode
124 
125 
126 Initialization
127 --------------
128 
129 When initiating an RF driver instance, the function #RF_open() accepts a
130 pointer to a #RF_Params object which might set several driver parameters. In
131 addition, it expects an #RF_Mode object and a setup command which is usually
132 generated by SmartRF Studio:
133 
134 @code
135 RF_Params rfParams;
136 RF_Params_init(&rfParams);
137 rfParams.nInactivityTimeout = 2000;
138 
139 RF_Handle rfHandle = RF_open(&rfObject, &RF_prop,
140  (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
141 @endcode
142 
143 The function #RF_open() returns a driver handle that is used for accessing the
144 correct driver instance. Please note that the first RF operation command
145 before an RX or TX operation command must be a `CMD_FS` to set the synthesizer
146 frequency. The RF driver caches both, the pointer to the setup command and the
147 physical `CMD_FS` for automatic power management.
148 
149 
150 Run-time configuration
151 ----------------------
152 
153 While a driver instance is opened, it can be re-configured with the function
154 #RF_control(). Various configuration parameters @ref RF_CTRL are available.
155 Example:
156 
157 @code
158 uint32_t timeoutUs = 2000;
159 RF_control(rfHandle, RF_CTRL_SET_INACTIVITY_TIMEOUT, &timeoutUs);
160 @endcode
161 
162 <hr>
163 @anchor rf_command_execution
164 Command execution
165 =================
166 
167 The RF core supports 3 different kinds of commands:
168 
169 1. Direct commands
170 2. Immediate commands
171 3. Radio operation commands
172 
173 Direct and immediate commands are dispatched via #RF_runDirectCmd() and
174 #RF_runImmediateCmd() respectively. These functions block until the command
175 has completed and return a status code of the type #RF_Stat when done.
176 
177 @code
178 #include <ti/devices/${DEVICE_FAMILY}/driverlib/rf_common_cmd.h>
179 
180 RF_Stat status = RF_runDirectCmd(rfHandle, CMD_ABORT);
181 assert(status == RF_StatCmdDoneSuccess);
182 @endcode
183 
184 Radio operation commands are potentially long-running commands and support
185 different triggers as well as conditional execution. Only one command can be
186 executed at a time, but the RF driver provides an internal queue that stores
187 commands until the RF core is free. Two interfaces are provided for radio
188 operation commands:
189 
190 1. Asynchronous: #RF_postCmd() and #RF_pendCmd()
191 2. Synchronous: #RF_runCmd()
192 
193 The asynchronous function #RF_postCmd() posts a radio operation into the
194 driver's internal command queue and returns a command handle of the type
195 #RF_CmdHandle which is an index in the command queue. The command is
196 dispatched as soon as the RF core has completed any previous radio operation
197 command.
198 
199 @code
200 #include <ti/devices/${DEVICE_FAMILY}/driverlib/rf_common_cmd.h>
201 
202 RF_Callback callback = NULL;
203 RF_EventMask subscribedEvents = 0;
204 RF_CmdHandle rxCommandHandle = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdRx,
205  RF_PriorityNormal, callback, subscribedEvents);
206 
207 assert(rxCommandHandle != RF_ALLOC_ERROR); // The command queue is full.
208 @endcode
209 
210 Command execution happens in background. The calling task may proceed with
211 other work or execute direct and immediate commands to interact with the
212 posted radio operation. But beware that the posted command might not have
213 started, yet. By calling the function #RF_pendCmd() and subscribing events of
214 the type #RF_EventMask, it is possible to re-synchronize to a posted command:
215 
216 @code
217 // RF_EventRxEntryDone must have been subscribed in RF_postCmd().
218 RF_EventMask events = RF_pendCmd(rfHandle, rxCommandHandle,
219  RF_EventRxEntryDone);
220 
221 // Program proceeds after RF_EventRxEntryDone or after a termination event.
222 @endcode
223 
224 The function #RF_runCmd() is a combination of both, #RF_postCmd() and
225 #RF_pendCmd() and allows synchronous execution.
226 
227 A pending or already running command might be aborted at any time by calling
228 the function #RF_cancelCmd() or #RF_flushCmd(). These functions take command
229 handles as parameters, but can also just abort anything in the RF driver's
230 queue:
231 
232 @code
233 uint8_t abortGraceful = 1;
234 
235 // Abort a single command
236 RF_cancelCmd(rfHandle, rxCommandHandle, abortGraceful);
237 
238 // Abort anything
239 RF_flushCmd(rfHandle, RF_CMDHANDLE_FLUSH_ALL, abortGraceful);
240 @endcode
241 
242 When aborting a command, the return value of #RF_runCmd() or #RF_pendCmd()
243 will contain the termination reason in form of event flags. If the command is
244 in the RF driver queue, but has not yet start, the #RF_EventCmdCancelled event is
245 raised.
246 
247 <hr>
248 @anchor rf_event_callbacks
249 Event callbacks
250 ===============
251 
252 The RF core generates multiple interrupts during command execution. The RF
253 driver maps these interrupts 1:1 to callback events of the type #RF_EventMask.
254 Hence, it is unnecessary to implement own interrupt handlers. Callback events
255 are divided into 3 groups:
256 
257 - Command-specific events, documented for each radio operation command. An example
258  is the #RF_EventRxEntryDone for the `CMD_PROP_RX`.
259 
260 - Generic events, defined for all radio operations and originating on the RF core.
261  These are for instance #RF_EventCmdDone and #RF_EventLastCmdDone. Both events
262  indicate the termination of one or more RF operations.
263 
264 - Generic events, defined for all radio operations and originating in the RF driver,
265  for instance #RF_EventCmdCancelled.
266 
267 @sa @ref RF_Core_Events, @ref RF_Driver_Events.
268 
269 How callback events are subscribed was shown in the previous section. The
270 following snippet shows a typical event handler callback for a proprietary RX
271 operation:
272 
273 @code
274 void rxCallback(RF_Handle handle, RF_CmdHandle command, RF_EventMask events)
275 {
276  if (events & RF_EventRxEntryDone)
277  {
278  Semaphore_post(rxPacketSemaphore);
279  }
280  if (events & RF_EventLastCmdDone)
281  {
282  // ...
283  }
284 }
285 @endcode
286 
287 In addition, the RF driver can generate error and power-up events that do not
288 relate directly to the execution of a radio command. Such events can be
289 subscribed by specifying the callback function pointers #RF_Params::pErrCb and
290 #RF_Params::pPowerCb.
291 
292 All callback functions run in software interrupt (SWI) context. Therefore,
293 only a minimum amount of code should be executed. When using absolute timed
294 commands with tight timing constraints, then it is recommended to set the RF
295 driver SWIs to a high priority.
296 See @ref rf_setup_and_configuration "Setup and configuration" for more details.
297 
298 <hr>
299 @anchor rf_power_management
300 Power management
301 ================
302 
303 The RF core is a hardware peripheral and can be switched on and off. The RF
304 driver handles that automatically and provides the following power
305 optimization features:
306 
307 - Lazy power-up and radio setup caching
308 - Power-down on inactivity
309 - Deferred dispatching of commands with absolute timing
310 
311 
312 Lazy power-up and radio setup caching
313 -------------------------------------
314 
315 The RF core optimizes the power consumption by enabling the RF core as late as
316 possible. For instance does #RF_open() not power up the RF core immediately.
317 Instead, it waits until the first radio operation command is dispatched by
318 #RF_postCmd() or #RF_runCmd().
319 
320 The function #RF_open() takes a radio setup command as parameter and expects a
321 `CMD_FS` command to follow. The pointer to the radio setup command and the
322 whole `CMD_FS` command are cached internally in the RF driver. They will be
323 used for every proceeding power-up procedure. Whenever the client re-runs a
324 setup command or a `CMD_FS` command, the driver updates its internal cache
325 with the new settings.
326 
327 By default, the RF driver measures the time that it needs for the power-up
328 procedure and uses that as an estimate for the next power cycle. On the
329 CC13x0/CC26x0 devices, power-up takes usually 1.6 ms. Automatic measurement
330 can be suppressed by specifying a custom power-up time with
331 #RF_Params::nPowerUpDuration. In addition, the client might set
332 #RF_Params::nPowerUpDurationMargin to cover any uncertainty when doing
333 automatic measurements. This is necessary in applications with a high hardware
334 interrupt load which can delay the RF driver's internal state machine
335 execution.
336 
337 
338 Power-down on inactivity
339 ------------------------
340 
341 Whenever a radio operation completes and there is no other radio operation in
342 the queue, the RF core might be powered down. There are two options in the RF
343 driver:
344 
345 - **Automatic power-down** by setting the parameter
346  #RF_Params::nInactivityTimeout. The RF core will then start a timer after
347  the last command in the queue has completed. The default timeout is "forever"
348  and this feature is disabled.
349 
350 - **Manual power-down** by calling #RF_yield(). The client should do this
351  whenever it knows that no further radio operation will be executed for a
352  couple of milliseconds.
353 
354 During the power-down procedure the RF driver stops the radio timer and saves
355 a synchronization timestamp for the next power-up. This keeps the radio timer
356 virtually in sync with the RTC even though it is not running all the time. The
357 synchronization is done in hardware.
358 
359 
360 Deferred dispatching of commands with absolute timing
361 -----------------------------------------------------
362 
363 When dispatching a radio operation command with an absolute start trigger that
364 is ahead in the future, the RF driver defers the execution and powers the RF
365 core down until the command is due. It does that only, when:
366 
367 1. `cmd.startTrigger.triggerType` is set to `TRIG_ABSTIME`
368 
369 2. The difference between #RF_getCurrentTime() and `cmd.startTime`
370  is at not more than 3/4 of a full RAT cycle. Otherwise the driver assumes
371  that `cmd.startTime` is in the past.
372 
373 3. There is enough time to run a full power cycle before `cmd.startTime` is
374  due. That includes:
375 
376  - the power-down time (fixed value, 1 ms) if the RF core is already
377  powered up,
378 
379  - the measured power-up duration or the value specified by
380  #RF_Params::nPowerUpDuration,
381 
382  - the power-up safety margin #RF_Params::nPowerUpDurationMargin
383  (the default is 282 microseconds).
384 
385 If one of the conditions are not fulfilled, the RF core is kept up and
386 running and the command is dispatched immediately. This ensures, that the
387 command will execute on-time and not miss the configured start trigger.
388 
389 <hr>
390 @anchor rf_scheduling
391 Preemptive scheduling of RF commands in multi-client applications
392 =================================================================
393 
394 Schedule BLE and proprietary radio commands.
395 
396 @code
397 RF_Object rfObject_ble;
398 RF_Object rfObject_prop;
399 
400 RF_Handle rfHandle_ble, rfHandle_prop;
401 RF_Params rfParams_ble, rfParams_prop;
402 RF_ScheduleCmdParams schParams_ble, schParams_prop;
403 
404 RF_Mode rfMode_ble =
405 {
406  .rfMode = RF_MODE_MULTIPLE, // rfMode for dual mode
407  .cpePatchFxn = &rf_patch_cpe_ble,
408  .mcePatchFxn = 0,
409  .rfePatchFxn = &rf_patch_rfe_ble,
410 };
411 
412 RF_Mode rfMode_prop =
413 {
414  .rfMode = RF_MODE_MULTIPLE, // rfMode for dual mode
415  .cpePatchFxn = &rf_patch_cpe_genfsk,
416  .mcePatchFxn = 0,
417  .rfePatchFxn = 0,
418 };
419 
420 // Init RF and specify non-default parameters
421 RF_Params_init(&rfParams_ble);
422 rfParams_ble.nInactivityTimeout = 200; // 200us
423 
424 RF_Params_init(&rfParams_prop);
425 rfParams_prop.nInactivityTimeout = 200; // 200us
426 
427 // Configure RF schedule command parameters directly.
428 schParams_ble.priority = RF_PriorityNormal;
429 schParams_ble.endTime = 0;
430 schParams_ble.allowDelay = RF_AllowDelayAny;
431 
432 // Alternatively, use the helper function to configure the default behavior
433 RF_ScheduleCmdParams_init(&schParams_prop);
434 
435 // Open BLE and proprietary RF handles
436 rfHandle_ble = RF_open(rfObj_ble, &rfMode_ble, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams_ble);
437 rfHandle_prop = RF_open(rfObj_prop, &rfMode_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams_prop);
438 
439 // Run a proprietary Fs command
440 RF_runCmd(rfHandle_pro, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, NULL);
441 
442 // Schedule a proprietary RX command
443 RF_scheduleCmd(rfHandle_pro, (RF_Op*)&RF_cmdPropRx, &schParams_prop, &prop_callback, RF_EventRxOk);
444 
445 // Schedule a BLE advertiser command
446 RF_scheduleCmd(rfHandle_ble, (RF_Op*)&RF_cmdBleAdv, &schParams_ble, &ble_callback,
447  (RF_EventLastCmdDone | RF_EventRxEntryDone | RF_EventTxEntryDone));
448 
449 @endcode
450 
451 <hr>
452 @anchor rf_rat
453 Accessing the Radio Timer (RAT)
454 ==============================
455 
456 The Radio Timer on the RF core is an independent 32 bit timer running at a
457 tick rate of 4 ticks per microsecond. It is only physically active while the
458 RF core is on. But because the RF driver resynchronizes the RAT to the RTC on
459 every power-up, it appears to the application as the timer is always running.
460 The RAT accuracy depends on the system HF clock while the RF core is active
461 and on the LF clock while the RF core is powered down.
462 
463 The current RAT time stamp can be obtained by #RF_getCurrentTime():
464 
465 @code
466 uint32_t now = RF_getCurrentTime();
467 @endcode
468 
469 The RAT has 8 independent channels that can be set up in capture and compare
470 mode by #RF_ratCapture() and #RF_ratCompare() respectively. Three of these
471 channels are accessible by the RF driver. Each channel may be connected to
472 physical hardware signals for input and output or may trigger a callback
473 function.
474 
475 In order to allocate a RAT channel and trigger a callback function at a
476 certain time stamp, use #RF_ratCompare():
477 
478 @code
479 RF_Handle rfDriver;
480 RF_RatConfigCompare config;
481 RF_RatConfigCompare_init(&config);
482 config.callback = &onRatTriggered;
483 config.channel = RF_RatChannelAny;
484 config.timeout = RF_getCurrentTime() + RF_convertMsToRatTicks(1701);
485 
486 RF_RatHandle ratHandle = RF_ratCompare(rfDriver, &config, nullptr);
487 assert(ratHandle != RF_ALLOC_ERROR);
488 
489 void onRatTriggered(RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compareCaptureTime)
490 {
491  if (e & RF_EventError)
492  {
493  // RF driver failed to trigger the callback on time.
494  }
495  printf("RAT has triggered at %u.", compareCaptureTime);
496 
497  // Trigger precisely with the same period again
498  config.timeout = compareCaptureTime + RF_convertMsToRatTicks(1701);
499  ratHandle = RF_ratCompare(rfDriver, &config, nullptr);
500  assert(ratHandle != RF_ALLOC_ERROR);
501 }
502 @endcode
503 
504 The RAT may be used to capture a time stamp on an edge of a physical pin. This
505 can be achieved with #RF_ratCapture().
506 
507 @code
508 #include <ti/drivers/pin/PINCC26XX.h>
509 // Map IO 26 to RFC_GPI0
510 PINCC26XX_setMux(pinHandle, IOID_26, PINCC26XX_MUX_RFC_GPI0);
511 
512 RF_Handle rfDriver;
513 RF_RatConfigCapture config;
514 RF_RatConfigCapture_init(&config);
515 config.callback = &onSignalTriggered;
516 config.channel = RF_RatChannelAny;
517 config.source = RF_RatCaptureSourceRfcGpi0;
518 config.captureMode = RF_RatCaptureModeRising;
519 config.repeat = RF_RatCaptureRepeat;
520 
521 RF_RatHandle ratHandle = RF_ratCapture(rfDriver, &config, nullptr);
522 assert(ratHandle != RF_ALLOC_ERROR);
523 
524 void onSignalTriggered(RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compareCaptureTime)
525 {
526  if (e & RF_EventError)
527  {
528  // An internal error has occurred
529  }
530  printf("Rising edge detected on IO 26 at %u.", compareCaptureTime);
531 }
532 @endcode
533 
534 In both cases, the RAT may generate an output signal when being triggered. The
535 signal can be routed to a physical IO pin:
536 
537 @code
538 // Generate a pulse on an internal RAT output signal
539 RF_RatConfigOutput output;
540 RF_RatConfigOutput_init(&output);
541 output.mode = RF_RatOutputModePulse;
542 output.select = RF_RatOutputSelectRatGpo3;
543 RF_ratCompare(...);
544 
545 // Map RatGpo3 to one of four intermediate doorbell signals.
546 // This has to be done in the override list in order to take permanent effect.
547 // The override list can be found in the RF settings .c file exported from
548 // SmartRF Studio.
549 // Attention: This will change the default mapping of the PA and LNA signal as well.
550 #include <ti/devices/[DEVICE_FAMILY]/inc/hw_rfc_dbell.h>
551 static uint32_t pOverrides[] =
552 {
553  HW_REG_OVERRIDE(0x1110, RFC_DBELL_SYSGPOCTL_GPOCTL2_RATGPO3),
554  // ...
555 }
556 
557 // Finally, route the intermediate doorbell signal to a physical pin.
558 #include <ti/drivers/pin/PINCC26XX.h>
559 PINCC26XX_setMux(pinHandle, IOID_17, PINCC26XX_MUX_RFC_GPO2);
560 @endcode
561 
562 <hr>
563 @anchor rf_tx_power
564 Programming the TX power level
565 ==============================
566 
567 The application can program a TX power level for each RF client with the function
568 #RF_setTxPower(). The new value takes immediate effect if the RF core is up and
569 running. Otherwise, it is stored in the RF driver client configuration.
570 
571 TX power may be stored in a lookup table in ascending order. This table is usually
572 generated and exported from SmartRF Studio together with the rest of the PHY configuration.
573 A typical power table my look as follows:
574 @code
575 RF_TxPowerTable_Entry txPowerTable[] = {
576  { .power = 11, .value = { 0x1233, RF_TxPowerTable_DefaultPA }},
577  { .power = 13, .value = { 0x1234, RF_TxPowerTable_DefaultPA }},
578  // ...
579  RF_TxPowerTable_TERMINATION_ENTRY
580 };
581 @endcode
582 
583 @note Some devices offer a high-power PA in addition to the default PA.
584 A client must not mix configuration values in the same power table and must
585 not hop from a default PA configuration to a high-power PA configuration unless it
586 can guarantee that the RF setup command is re-executed in between.
587 
588 Given this power table format, the application may program a new power level in multiple
589 ways. It can use convenience functions to search a certain power level
590 in the power table or may access the table index-based:
591 @code
592 // Set a certain power level. Search a matching level.
593 RF_setTxPower(h, RF_TxPowerTable_findValue(txPowerTable, 17));
594 
595 // Set a certain power level with a known level.
596 RF_setTxPower(h, txPowerTable[3].value);
597 
598 // Set a certain power without using a human readable level.
599 RF_setTxPower(h, value);
600 
601 // Set maximum power. Search the value.
602 RF_setTxPower(h, RF_TxPowerTable_findValue(txPowerTable, RF_TxPowerTable_MAX_DBM));
603 
604 // Set minimum power without searching.
605 RF_setTxPower(h, txPowerTable[0].value);
606 
607 // Set minimum power. Search the value.
608 RF_setTxPower(h, RF_TxPowerTable_findValue(txPowerTable, RF_TxPowerTable_MIN_DBM));
609 
610 // Set maximum power without searching.
611 int32_t lastIndex = sizeof(txPowerTable) / sizeof(RF_TxPowerTable_Entry) - 2;
612 RF_setTxPower(h, txPowerTable[lastIndex].value);
613 @endcode
614 
615 The current configured power level for a client can be retrieved by #RF_getTxPower().
616 @code
617 // Get the current configured power level.
618 int8_t power = RF_TxPowerTable_findPowerLevel(txPowerTable, RF_getTxPower(h));
619 @endcode
620 
621 <hr>
622 @anchor rf_convenience_features
623 Convenience features
624 ====================
625 
626 The RF driver simplifies often needed tasks and provides additional functions.
627 For instance, it can read the RSSI while the RF core is in RX mode using the
628 function :tidrivers_api:`RF_getRssi`:
629 
630 @code
631 int8_t rssi = RF_getRssi(rfHandle);
632 assert (rssi != RF_GET_RSSI_ERROR_VAL); // Could not read the RSSI
633 @endcode
634 
635 <hr>
636  ******************************************************************************
637  */
638 
639 //*****************************************************************************
640 //
645 //
646 //*****************************************************************************
647 
648 #ifndef ti_drivers_rfcc26x2__include
649 #define ti_drivers_rfcc26x2__include
650 
651 #ifdef __cplusplus
652 extern "C" {
653 #endif
654 
655 #include <stdint.h>
656 #include <stdbool.h>
657 
658 #include <ti/drivers/dpl/ClockP.h>
659 #include <ti/drivers/dpl/SemaphoreP.h>
660 #include <ti/drivers/utils/List.h>
661 
662 #include <ti/devices/DeviceFamily.h>
663 #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
664 #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
665 #include DeviceFamily_constructPath(driverlib/rf_ble_cmd.h)
666 
678 #define RF_EventCmdDone (1 << 0)
679 #define RF_EventLastCmdDone (1 << 1)
680 #define RF_EventFGCmdDone (1 << 2)
681 #define RF_EventLastFGCmdDone (1 << 3)
682 #define RF_EventTxDone (1 << 4)
683 #define RF_EventTXAck (1 << 5)
684 #define RF_EventTxCtrl (1 << 6)
685 #define RF_EventTxCtrlAck (1 << 7)
686 #define RF_EventTxCtrlAckAck (1 << 8)
687 #define RF_EventTxRetrans (1 << 9)
688 #define RF_EventTxEntryDone (1 << 10)
689 #define RF_EventTxBufferChange (1 << 11)
690 #define RF_EventPaChanged (1 << 14)
691 #define RF_EventSamplesEntryDone (1 << 15)
692 #define RF_EventRxOk (1 << 16)
693 #define RF_EventRxNOk (1 << 17)
694 #define RF_EventRxIgnored (1 << 18)
695 #define RF_EventRxEmpty (1 << 19)
696 #define RF_EventRxCtrl (1 << 20)
697 #define RF_EventRxCtrlAck (1 << 21)
698 #define RF_EventRxBufFull (1 << 22)
699 #define RF_EventRxEntryDone (1 << 23)
700 #define RF_EventDataWritten (1 << 24)
701 #define RF_EventNDataWritten (1 << 25)
702 #define RF_EventRxAborted (1 << 26)
703 #define RF_EventRxCollisionDetected (1 << 27)
704 #define RF_EventModulesUnlocked (1 << 29)
705 #define RF_EventInternalError (uint32_t)(1 << 31)
706 #define RF_EventMdmSoft 0x0000002000000000
707 
716 #define RF_EventCmdCancelled 0x1000000000000000
717 #define RF_EventCmdAborted 0x2000000000000000
718 #define RF_EventCmdStopped 0x4000000000000000
719 #define RF_EventRatCh 0x0800000000000000
720 #define RF_EventPowerUp 0x0400000000000000
721 #define RF_EventError 0x0200000000000000
722 #define RF_EventCmdPreempted 0x0100000000000000
723 
741 #define RF_CTRL_SET_INACTIVITY_TIMEOUT 0
742 
751 #define RF_CTRL_UPDATE_SETUP_CMD 1
752 
757 #define RF_CTRL_SET_POWERUP_DURATION_MARGIN 2
758 
765 #define RF_CTRL_SET_PHYSWITCHING_DURATION_MARGIN 3
766 
773 #define RF_CTRL_SET_RAT_RTC_ERR_TOL_VAL 4
774 
785 #define RF_CTRL_SET_POWER_MGMT 5
786 
807 #define RF_CTRL_SET_HWI_PRIORITY 6
808 
829 #define RF_CTRL_SET_SWI_PRIORITY 7
830 
839 #define RF_CTRL_SET_AVAILABLE_RAT_CHANNELS_MASK 8
840 
854 #define RF_CTRL_COEX_CONTROL 9
855 
868 #define RF_TxPowerTable_MIN_DBM -128
869 
876 #define RF_TxPowerTable_MAX_DBM 126
877 
883 #define RF_TxPowerTable_INVALID_DBM 127
884 
902 #define RF_TxPowerTable_INVALID_VALUE 0x3fffff
903 
919 #define RF_TxPowerTable_TERMINATION_ENTRY \
920  { .power = RF_TxPowerTable_INVALID_DBM, .value = { .rawValue = RF_TxPowerTable_INVALID_VALUE, .paType = RF_TxPowerTable_DefaultPA } }
921 
928 #define RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost, coefficient) \
929  { .rawValue = ((bias) << 0) | ((gain) << 6) | ((boost) << 8) | ((coefficient) << 9), .paType = RF_TxPowerTable_DefaultPA }
930 
937 #define RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldotrim) \
938  { .rawValue = ((bias) << 0) | ((ibboost) << 6) | ((boost) << 8) | ((coefficient) << 9) | ((ldotrim) << 16), .paType = RF_TxPowerTable_HighPA }
939 
940 
947 #define RF_GET_RSSI_ERROR_VAL (-128)
948 #define RF_CMDHANDLE_FLUSH_ALL (-1)
949 #define RF_ALLOC_ERROR (-2)
950 #define RF_SCHEDULE_CMD_ERROR (-3)
951 #define RF_ERROR_RAT_PROG (-255)
952 #define RF_ERROR_INVALID_RFMODE (-256)
953 #define RF_ERROR_CMDFS_SYNTH_PROG (-257)
954 
955 #define RF_NUM_SCHEDULE_ACCESS_ENTRIES 2
956 #define RF_NUM_SCHEDULE_COMMAND_ENTRIES 8
957 #define RF_NUM_SCHEDULE_MAP_ENTRIES (RF_NUM_SCHEDULE_ACCESS_ENTRIES + RF_NUM_SCHEDULE_COMMAND_ENTRIES)
958 #define RF_SCH_MAP_CURRENT_CMD_OFFSET RF_NUM_SCHEDULE_ACCESS_ENTRIES
959 #define RF_SCH_MAP_PENDING_CMD_OFFSET (RF_SCH_MAP_CURRENT_CMD_OFFSET + 2)
960 
961 #define RF_ABORT_PREEMPTION (1<<2)
962 #define RF_ABORT_GRACEFULLY (1<<0)
963 
964 #define RF_SCH_CMD_EXECUTION_TIME_UNKNOWN 0
965 
966 #define RF_RAT_ANY_CHANNEL (-1)
967 #define RF_RAT_TICKS_PER_US 4
968 
969 #define RF_LODIVIDER_MASK 0x7F
970 
971 
978 #define RF_STACK_ID_DEFAULT 0x00000000
979 #define RF_STACK_ID_154 0x8000F154
980 #define RF_STACK_ID_BLE 0x8000FB1E
981 #define RF_STACK_ID_EASYLINK 0x8000FEA2
982 #define RF_STACK_ID_THREAD 0x8000FEAD
983 #define RF_STACK_ID_TOF 0x8000F00F
984 #define RF_STACK_ID_CUSTOM 0x0000FC00
985 
990 #define RF_convertUsToRatTicks(microseconds) \
991  ((microseconds) * (RF_RAT_TICKS_PER_US))
992 
996 #define RF_convertMsToRatTicks(milliseconds) \
997  ((milliseconds) * 1000 * (RF_RAT_TICKS_PER_US))
998 
1002 #define RF_convertRatTicksToUs(ticks) \
1003  ((ticks) / (RF_RAT_TICKS_PER_US))
1004 
1008 #define RF_convertRatTicksToMs(ticks) \
1009  ((ticks) / (1000 * (RF_RAT_TICKS_PER_US)))
1010 
1011 
1023 typedef struct {
1024  uint32_t rawValue:22;
1025  uint32_t __dummy:9;
1029  uint32_t paType:1;
1034 
1053 typedef struct
1054 {
1055  int8_t power;
1056 
1059 } __attribute__((packed)) RF_TxPowerTable_Entry;
1060 
1061 
1068 typedef enum {
1072 
1073 
1088 
1089 
1098 typedef struct {
1099  uint8_t rfMode;
1100  void (*cpePatchFxn)(void);
1101  void (*mcePatchFxn)(void);
1102  void (*rfePatchFxn)(void);
1103 } RF_Mode;
1104 
1115 typedef enum {
1119 } RF_Priority;
1120 
1131 typedef enum {
1135 } RF_PriorityCoex;
1136 
1147 typedef enum {
1151 } RF_RequestCoex;
1152 
1159 typedef struct {
1162 } RF_CoexOverride;
1163 
1170 typedef struct {
1176 
1185 typedef enum {
1191  RF_StatError = 0x80,
1195 } RF_Stat;
1196 
1201 typedef uint64_t RF_EventMask;
1202 
1212 typedef union {
1214  rfc_CMD_RADIO_SETUP_t common;
1223 } RF_RadioSetup;
1224 
1253 typedef enum {
1256 
1260 } RF_ClientEvent;
1261 
1323 typedef enum {
1325 
1329 
1332  RF_GlobalEventInit = (1 << 2),
1333 
1337 
1341 
1345 } RF_GlobalEvent;
1348 
1349 
1353 typedef uint32_t RF_ClientEventMask;
1354 
1358 typedef uint32_t RF_GlobalEventMask;
1359 
1372 typedef int16_t RF_CmdHandle;
1373 
1394 typedef struct RF_ObjectMultiMode RF_Object;
1395 
1399 struct RF_ObjectMultiMode{
1401  struct {
1402  uint32_t nInactivityTimeout;
1403  RF_Mode* pRfMode;
1404  RF_RadioSetup* pRadioSetup;
1405  uint32_t nPhySwitchingDuration;
1406  uint32_t nPowerUpDuration;
1407  bool bMeasurePowerUpDuration;
1408  bool bUpdateSetup;
1409  uint16_t nPowerUpDurationMargin;
1410  void* pPowerCb;
1411  void* pErrCb;
1412  void* pClientEventCb;
1413  RF_ClientEventMask nClientEventMask;
1414  uint16_t nPhySwitchingDurationMargin;
1415  uint32_t nID;
1416  } clientConfig;
1418  struct {
1419  struct {
1420  rfc_CMD_FS_t cmdFs;
1421  } mode_state;
1422  SemaphoreP_Struct semSync;
1423  RF_EventMask volatile eventSync;
1424  void* pCbSync;
1425  RF_EventMask unpendCause;
1426  ClockP_Struct clkReqAccess;
1427  bool bYielded;
1428  } state;
1429 };
1430 
1439 
1440 
1449 typedef int8_t RF_RatHandle;
1450 
1454 typedef enum {
1461 } RF_InfoType;
1462 
1468 typedef union {
1469  RF_CmdHandle ch;
1470  uint16_t availRatCh;
1472  RF_Handle pClientList[2];
1473  uint32_t phySwitchingTimeInUs[2];
1475 } RF_InfoVal;
1476 
1480 typedef struct {
1481  RF_CmdHandle ch;
1482  RF_Handle pClient;
1483  uint32_t startTime;
1484  uint32_t endTime;
1487 
1491 typedef struct {
1494 } RF_ScheduleMap;
1495 
1521 typedef void (*RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
1522 
1536 typedef void (*RF_RatCallback)(RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compareCaptureTime);
1537 
1553 typedef void (*RF_ClientCallback)(RF_Handle h, RF_ClientEvent event, void* arg);
1554 
1568 typedef void (*RF_GlobalCallback)(RF_Handle h, RF_GlobalEvent event, void* arg);
1569 
1578 typedef struct {
1580 
1582  uint32_t nPowerUpDuration;
1583 
1587 
1590 
1592 
1597 
1599 
1601  RF_ClientEventMask nClientEventMask;
1602 
1604  uint32_t nID;
1605 } RF_Params;
1606 
1610 typedef enum {
1613 } RF_StartType;
1614 
1618 typedef enum {
1623  } RF_EndType;
1624 
1625 /* RF command. */
1626 typedef struct RF_Cmd_s RF_Cmd;
1627 
1628 /* RF command . */
1629 struct RF_Cmd_s {
1630  List_Elem _elem; /* Pointer to next and previous elements. */
1631  RF_Callback volatile pCb; /* Pointer to callback function */
1632  RF_Op* pOp; /* Pointer to (chain of) RF operations(s) */
1633  RF_Object* pClient; /* Pointer to client */
1634  RF_EventMask bmEvent; /* Enable mask for interrupts from the command */
1635  RF_EventMask pastifg; /* Accumulated value of events happened within a command chain */
1636  RF_EventMask rfifg; /* Return value for callback 0:31 - RF_CPE0_INT, 32:63 - RF_HW_INT */
1637  RF_CmdHandle ch; /* Command handle */
1638  RF_Priority ePri; /* Priority of RF command */
1639  uint8_t volatile flags; /* [0: Aborted, 1: Stopped, 2: canceled] */
1640  uint32_t startTime; /* Command start time (in RAT ticks) */
1641  RF_StartType startType; /* Command start time type */
1642  uint32_t allowDelay; /* Delay allowed if the start time cannot be met. */
1643  uint32_t endTime; /* Command end time (in RAT ticks) */
1644  RF_EndType endType; /* Command end type */
1645  uint32_t duration; /* Command duration (in RAT ticks) */
1646  uint32_t activityInfo; /* General value supported by user */
1647  RF_PriorityCoex coexPriority; /* Command priority to use for coexistence request. */
1648  RF_RequestCoex coexRequest; /* Command REQUEST line behavior to use for coexistence request. */
1649 };
1650 
1656 typedef struct {
1657  uint8_t hwiPriority;
1658  uint8_t swiPriority;
1661  RF_GlobalEventMask globalEventMask;
1663 
1668 typedef enum
1669 {
1674 
1677 typedef enum
1678 {
1686 
1705 typedef RF_ScheduleStatus (*RF_SubmitHook)(RF_Cmd* pCmdNew, RF_Cmd* pCmdBg, RF_Cmd* pCmdFg, List_List* pPendQueue, List_List* pDoneQueue);
1706 
1724 typedef RF_ExecuteAction (*RF_ExecuteHook)(RF_Cmd* pCmdBg, RF_Cmd* pCmdFg, List_List* pPendQueue, List_List* pDoneQueue, bool bConflict, RF_Cmd* conflictCmd);
1725 
1731 typedef struct {
1735 
1739 typedef enum {
1741  RF_AllowDelayAny = UINT32_MAX
1742 } RF_AllowDelay;
1743 
1744 /* @brief RF schedule command parameter struct
1745  *
1746  * RF schedule command parameters are used with the RF_scheduleCmd() call.
1747  */
1748 typedef struct {
1749  uint32_t startTime;
1751  uint32_t allowDelay;
1752  uint32_t endTime;
1757  uint32_t duration;
1758  uint32_t activityInfo;
1762 
1767 typedef struct {
1768  uint32_t duration;
1769  uint32_t startTime;
1771 } RF_AccessParams;
1772 
1779 typedef enum {
1785 
1791 typedef enum {
1801 
1807 typedef enum {
1813 
1820 typedef enum {
1824 
1839 typedef enum {
1847 
1857 typedef enum {
1866 
1871 typedef struct {
1873  RF_RatHandle channel;
1878 
1883 typedef struct {
1885  RF_RatHandle channel;
1886  uint32_t timeout;
1889 
1894 typedef struct {
1898 
1931 extern RF_Handle RF_open(RF_Object *pObj, RF_Mode *pRfMode, RF_RadioSetup *pRadioSetup, RF_Params *params);
1932 
1946 extern void RF_close(RF_Handle h);
1947 
1958 extern uint32_t RF_getCurrentTime(void);
1959 
2014 extern RF_CmdHandle RF_postCmd(RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent);
2015 
2026 extern RF_ScheduleStatus RF_defaultSubmitPolicy(RF_Cmd* pCmdNew, RF_Cmd* pCmdBg, RF_Cmd* pCmdFg, List_List* pPendQueue, List_List* pDoneQueue);
2027 
2039 extern RF_ExecuteAction RF_defaultExecutionPolicy(RF_Cmd* pCmdBg, RF_Cmd* pCmdFg, List_List* pPendQueue, List_List* pDoneQueue, bool bConflict, RF_Cmd* conflictCmd);
2040 
2041 
2050 extern void RF_ScheduleCmdParams_init(RF_ScheduleCmdParams *pSchParams);
2051 
2078 extern RF_CmdHandle RF_scheduleCmd(RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent);
2079 
2139 extern RF_EventMask RF_pendCmd(RF_Handle h, RF_CmdHandle ch, RF_EventMask bmEvent);
2140 
2168 extern RF_EventMask RF_runCmd(RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent);
2169 
2189 extern RF_EventMask RF_runScheduleCmd(RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent);
2190 
2210 extern RF_Stat RF_cancelCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
2211 
2230 extern RF_Stat RF_flushCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
2231 
2245 extern RF_Stat RF_runImmediateCmd(RF_Handle h, uint32_t *pCmdStruct);
2246 
2260 extern RF_Stat RF_runDirectCmd(RF_Handle h, uint32_t cmd);
2261 
2276 extern void RF_yield(RF_Handle h);
2277 
2288 extern void RF_Params_init(RF_Params *params);
2289 
2300 extern RF_Stat RF_getInfo(RF_Handle h, RF_InfoType type, RF_InfoVal *pValue);
2301 
2310 extern int8_t RF_getRssi(RF_Handle h);
2311 
2321 extern RF_Op* RF_getCmdOp(RF_Handle h, RF_CmdHandle cmdHnd);
2322 
2331 extern void RF_RatConfigCompare_init(RF_RatConfigCompare* channelConfig);
2332 
2341 extern void RF_RatConfigCapture_init(RF_RatConfigCapture* channelConfig);
2342 
2351 extern void RF_RatConfigOutput_init(RF_RatConfigOutput* ioConfig);
2352 
2394 extern RF_RatHandle RF_ratCompare(RF_Handle rfHandle, RF_RatConfigCompare* channelConfig, RF_RatConfigOutput* ioConfig);
2395 
2435 extern RF_RatHandle RF_ratCapture(RF_Handle rfHandle, RF_RatConfigCapture* channelConfig, RF_RatConfigOutput* ioConfig);
2436 
2454 extern RF_Stat RF_ratDisableChannel(RF_Handle rfHandle, RF_RatHandle ratHandle);
2455 
2466 extern RF_Stat RF_control(RF_Handle h, int8_t ctrl, void *args);
2467 
2486 extern RF_Stat RF_requestAccess(RF_Handle h, RF_AccessParams *pParams);
2487 
2507 extern RF_TxPowerTable_Value RF_getTxPower(RF_Handle h);
2508 
2528 extern RF_Stat RF_setTxPower(RF_Handle h, RF_TxPowerTable_Value value);
2529 
2549 
2574 extern RF_TxPowerTable_Value RF_TxPowerTable_findValue(RF_TxPowerTable_Entry table[], int8_t powerLevel);
2575 
2576 
2581 extern void RF_enableHPOSCTemperatureCompensation(void);
2582 
2583 #ifdef __cplusplus
2584 }
2585 #endif
2586 
2587 #endif /* ti_drivers_rfcc26x2__include */
2588 
2589 //*****************************************************************************
2590 //
2594 //
2595 //*****************************************************************************
RF Hardware attributes.
Definition: RFCC26X2.h:1656
Definition: RFCC26X2.h:1620
uint32_t allowDelay
Definition: RFCC26X2.h:1751
RF_RatCaptureMode captureMode
Configuration of the mode of event to cause a capture event.
Definition: RFCC26X2.h:1875
Default PA.
Definition: RFCC26X2.h:1069
Generates a one-clock period width pulse.
Definition: RFCC26X2.h:1840
RF_CmdHandle ch
Command handle (RF_GET_CURR_CMD).
Definition: RFCC26X2.h:1469
RF_StartType startType
Definition: RFCC26X2.h:1641
Definition: RFCC26X2.h:1344
RF_EventMask RF_pendCmd(RF_Handle h, RF_CmdHandle ch, RF_EventMask bmEvent)
Synchronizes the calling task to an RF operation command ch and returns accumulated event flags...
Highest priority. Only use this for urgent commands.
Definition: RFCC26X2.h:1116
Configure RAT_CHANNEL[x] to interface with RAT_GPO[4].
Definition: RFCC26X2.h:1861
RF driver configuration parameters.
Definition: RFCC26X2.h:1578
rfc_CMD_RADIO_SETUP_PA_t common_pa
Radio setup command for BLE and IEEE modes with High Gain PA.
Definition: RFCC26X2.h:1219
RF_TxPowerTable_Value RF_TxPowerTable_findValue(RF_TxPowerTable_Entry table[], int8_t powerLevel)
Retrieves a power configuration value for a given power level in dBm.
uint32_t startTime
Start time window in RAT Time for radio access.
Definition: RFCC26X2.h:1769
RF_Callback volatile pCb
Definition: RFCC26X2.h:1631
RF_RatCallback callback
Callback function to be invoked upon a capture event (optional).
Definition: RFCC26X2.h:1884
Definition: RFCC26X2.h:1619
#define RF_NUM_SCHEDULE_ACCESS_ENTRIES
Number of access request entries.
Definition: RFCC26X2.h:955
Use RAT user channel 0.
Definition: RFCC26X2.h:1781
void RF_RatConfigOutput_init(RF_RatConfigOutput *ioConfig)
Initialize the configuration structure to be used to set up a RAT IO.
uint32_t RF_getCurrentTime(void)
Return current radio timer value.
Definition: RFCC26X2.h:1741
Function was called with an invalid parameter.
Definition: RFCC26X2.h:1189
void(* RF_GlobalCallback)(RF_Handle h, RF_GlobalEvent event, void *arg)
Handles global events as part of PHY configuration.
Definition: RFCC26X2.h:1568
uint16_t nPowerUpDurationMargin
Definition: RFCC26X2.h:1591
Definition: RFCC26X2.h:1797
RF_ExecuteHook executeHook
Function hook implements the runtime last second go-no-go execute decision.
Definition: RFCC26X2.h:1733
Frequency Synthesizer Programming Command.
Definition: rf_common_cmd.h:237
Create a bitmask showing available RAT channels.
Definition: RFCC26X2.h:1456
int8_t RF_getRssi(RF_Handle h)
Get RSSI value.
rfc_CMD_PROP_RADIO_SETUP_PA_t prop_pa
Radio setup command for PROPRIETARY mode on 2.4 GHz with High Gain PA.
Definition: RFCC26X2.h:1221
uint8_t rfMode
Specifies which PHY modes should be activated. Must be set to RF_MODE_MULTIPLE for dual-mode operatio...
Definition: RFCC26X2.h:1099
void RF_close(RF_Handle h)
Close client connection to RF driver.
Definition: RFCC26X2.h:1332
RF_AllowDelay
Controls the behavior of the RF_scheduleCmd() API.
Definition: RFCC26X2.h:1739
Coexistence override settings for BLE5 application scenarios.
Definition: RFCC26X2.h:1170
Definition: RFCC26X2.h:1740
Command finished with an error.
Definition: RFCC26X2.h:1188
RF_ClientEventMask nClientEventMask
Definition: RFCC26X2.h:1601
RF_EndType endType
Definition: RFCC26X2.h:1644
Free the channel after the first capture event.
Definition: RFCC26X2.h:1821
Configure RAT_CHANNEL[x] to interface with RAT_GPO[5].
Definition: RFCC26X2.h:1862
RF_ScheduleStatus
Describes the location within the pend queue where the new command was inserted by the scheduler...
Definition: RFCC26X2.h:1677
RF schedule map entry structure.
Definition: RFCC26X2.h:1480
RF_ExecuteAction
Controls the behavior of the state machine of the RF driver when a conflict is identified run-time be...
Definition: RFCC26X2.h:1668
Chose the first available channel.
Definition: RFCC26X2.h:1780
RF_EventMask RF_runCmd(RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent)
Runs synchronously an RF operation command or a chain of commands and returns the termination reason...
void RF_ScheduleCmdParams_init(RF_ScheduleCmdParams *pSchParams)
Initialize the configuration structure to default values to be used with the RF_scheduleCmd() API...
RF_Stat RF_requestAccess(RF_Handle h, RF_AccessParams *pParams)
Request radio access.
uint32_t allowDelay
Definition: RFCC26X2.h:1642
Cmd is found in the pool but was already ended.
Definition: RFCC26X2.h:1190
Selects the RTC update signal source.
Definition: RFCC26X2.h:1792
Configure RAT_CHANNEL[x] to interface with RAT_GPO[2].
Definition: RFCC26X2.h:1859
RF_EventMask rfifg
Definition: RFCC26X2.h:1636
Definition: RFCC26X2.h:1629
Definition: RFCC26X2.h:1621
RF_RatHandle channel
RF_RatHandle identifies the channel to be allocated.
Definition: RFCC26X2.h:1873
RF_PriorityCoex priority
Priority level for coexistence priority signal.
Definition: RFCC26X2.h:1160
Low priority. Override default value configured by setup command.
Definition: RFCC26X2.h:1133
RF_Handle RF_open(RF_Object *pObj, RF_Mode *pRfMode, RF_RadioSetup *pRadioSetup, RF_Params *params)
Creates a a new client instance of the RF driver.
uint32_t nPowerUpDuration
Definition: RFCC26X2.h:1582
Retrieve a command handle of the current command.
Definition: RFCC26X2.h:1455
High priority. Override default value configured by setup command.
Definition: RFCC26X2.h:1134
Execute if no conflict, let current command finish if conflict.
Definition: RFCC26X2.h:1670
uint8_t swiPriority
Priority for SWIs belong to the RF driver.
Definition: RFCC26X2.h:1658
RF_ExecuteAction(* RF_ExecuteHook)(RF_Cmd *pCmdBg, RF_Cmd *pCmdFg, List_List *pPendQueue, List_List *pDoneQueue, bool bConflict, RF_Cmd *conflictCmd)
Defines the execution and conflict resolution hook at runtime.
Definition: RFCC26X2.h:1724
Rising edge of the selected source will trigger a capture event.
Definition: RFCC26X2.h:1808
void RF_enableHPOSCTemperatureCompensation(void)
Enables temperature monitoring and temperature based drift compensation.
RF_Stat RF_setTxPower(RF_Handle h, RF_TxPowerTable_Value value)
Updates the transmit power configuration of the RF core.
Definition: RFCC26X2.h:1324
uint8_t volatile flags
Definition: RFCC26X2.h:1639
uint32_t duration
Duration in RAT Ticks for the radio command.
Definition: RFCC26X2.h:1757
rfc_CMD_PROP_RADIO_DIV_SETUP_t prop_div
Radio setup command for PROPRIETARY mode on Sub-1 Ghz.
Definition: RFCC26X2.h:1218
List_Elem _elem
Definition: RFCC26X2.h:1630
RF_GlobalEventMask globalEventMask
Event mask which the globalCallback is invoked upon.
Definition: RFCC26X2.h:1661
RF_RatOutputSelect
Selects GPO to be used with RF_ratCompare() or RF_ratCapture().
Definition: RFCC26X2.h:1857
RF_Op * RF_getCmdOp(RF_Handle h, RF_CmdHandle cmdHnd)
Get command structure pointer.
Stores output parameters for RF_getInfo().
Definition: RFCC26X2.h:1468
RF_Handle pClient
Pointer to client object.
Definition: RFCC26X2.h:1482
RF_CmdHandle RF_postCmd(RF_Handle h, RF_Op *pOp, RF_Priority ePri, RF_Callback pCb, RF_EventMask bmEvent)
Appends RF operation commands to the driver&#39;s command queue and returns a command handle...
RF_RatHandle RF_ratCapture(RF_Handle rfHandle, RF_RatConfigCapture *channelConfig, RF_RatConfigOutput *ioConfig)
Setup a Radio Timer (RAT) channel in capture mode.
Default priority. Use this in single-client applications.
Definition: RFCC26X2.h:1118
RF_CmdHandle ch
Definition: RFCC26X2.h:1637
Provide the client list.
Definition: RFCC26X2.h:1459
RF_Priority ePri
Definition: RFCC26X2.h:1638
RF_EndType endType
End type for the end time.
Definition: RFCC26X2.h:1756
RF_CoexOverride bleObserver
Definition: RFCC26X2.h:1174
Definition: rf_common_cmd.h:112
RF_RatOutputMode
Selects the mode of the RAT_GPO[x] for RF_ratCompare() or RF_ratCapture().
Definition: RFCC26X2.h:1839
RAT related IO parameter structure.
Definition: RFCC26X2.h:1894
High-power PA.
Definition: RFCC26X2.h:1070
RF_CmdHandle ch
Command handle.
Definition: RFCC26X2.h:1481
Inverts the polarity of the output.
Definition: RFCC26X2.h:1843
RF_RequestCoex request
Behavior for coexistence request signal.
Definition: RFCC26X2.h:1161
RF_InfoType
Selects the entry of interest in RF_getInfo().
Definition: RFCC26X2.h:1454
uint32_t startTime
Start time in RAT Ticks for the radio command.
Definition: RFCC26X2.h:1749
RF_Priority priority
Priority of the command or access request.
Definition: RFCC26X2.h:1485
Definition: RFCC26X2.h:1255
RF_Stat RF_flushCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode)
Abort/stop/cancel command and any subsequent commands in command queue.
RF_StartType
Controls the behavior of the RF_scheduleCmd() API.
Definition: RFCC26X2.h:1610
void RF_RatConfigCompare_init(RF_RatConfigCompare *channelConfig)
Initialize the configuration structure to be used to set up a RAT compare event.
Definition: RFCC26X2.h:1682
RF_ratCapture parameter structure.
Definition: RFCC26X2.h:1871
Definition: rf_prop_cmd.h:902
Runtime coexistence override parameters.
Definition: RFCC26X2.h:1159
Falling edge of the selected source will trigger a capture event.
Definition: RFCC26X2.h:1809
bool bRadioState
Current RF core power state (RF_GET_RADIO_STATE).
Definition: RFCC26X2.h:1471
RF_RatCaptureMode
Selects the mode of RF_ratCapture().
Definition: RFCC26X2.h:1807
RF_RatOutputSelect select
The signal which shall be connected to the GPO.
Definition: RFCC26X2.h:1896
RF_EndType
Controls the behavior of the RF_scheduleCmd() API.
Definition: RFCC26X2.h:1618
void(* RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
Handles events related to RF command execution.
Definition: RFCC26X2.h:1521
RF_CmdHandle RF_scheduleCmd(RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent)
Schedule an RF operation (chain) to the command queue.
Proprietary Mode Radio Setup Command for 2.4 GHz.
Definition: rf_prop_cmd.h:455
#define RF_NUM_SCHEDULE_COMMAND_ENTRIES
Number of scheduled command entries.
Definition: RFCC26X2.h:956
Definition: rf_common_cmd.h:681
uint32_t endTime
Definition: RFCC26X2.h:1643
uint32_t activityInfo
Activity info provided by user.
Definition: RFCC26X2.h:1758
RF_ScheduleStatus RF_defaultSubmitPolicy(RF_Cmd *pCmdNew, RF_Cmd *pCmdBg, RF_Cmd *pCmdFg, List_List *pPendQueue, List_List *pDoneQueue)
Sorts and adds commands to the RF driver internal command queue.
uint32_t duration
Radio access duration in RAT Ticks requested by the client.
Definition: RFCC26X2.h:1768
Command successfully scheduled for execution.
Definition: RFCC26X2.h:1193
RF_RatCaptureSource source
Configuration of the event source to cause a capture event.
Definition: RFCC26X2.h:1874
Configure RAT_CHANNEL[x] to interface with RAT_GPO[6].
Definition: RFCC26X2.h:1863
Radio Setup Command for Pre-Defined Schemes.
Definition: rf_common_cmd.h:176
RF_RatCaptureRepetition repeat
Configuration of the channel to be used in single or repeated mode.
Definition: RFCC26X2.h:1876
Proprietary Mode Radio Setup Command for All Frequency Bands.
Definition: rf_prop_cmd.h:561
Command not executed because RF core is powered down.
Definition: RFCC26X2.h:1187
uint32_t startTime
Start time (in RAT tick) of the command or access request.
Definition: RFCC26X2.h:1483
Do not assert REQUEST in RX. Override default value configured by setup command.
Definition: RFCC26X2.h:1150
RF_GlobalCallback globalCallback
Pointer to a callback function serving client independent events listed in RF_GlobalEvent.
Definition: RFCC26X2.h:1660
RF_TxPowerTable_PAType
Selects a power amplifier path in a TX power value.
Definition: RFCC26X2.h:1068
RF_RequestCoex coexRequest
REQUEST line behavior to use for coexistence request.
Definition: RFCC26X2.h:1760
RF_CoexOverride bleBroadcaster
Definition: RFCC26X2.h:1173
RF_Stat RF_control(RF_Handle h, int8_t ctrl, void *args)
Set RF control parameters.
Definition: RFCC26X2.h:1611
Selects the Generic event of Event Fabric as source.
Definition: RFCC26X2.h:1793
void RF_yield(RF_Handle h)
Signal that radio client is not going to issue more commands in a while.
Definition: RFCC26X2.h:1748
Definition: RFCC26X2.h:1679
Definition: RFCC26X2.h:1681
The RF core has been powered up the radio setup has been finished.
Definition: RFCC26X2.h:1254
void(* RF_ClientCallback)(RF_Handle h, RF_ClientEvent event, void *arg)
Handles events related to a driver instance.
Definition: RFCC26X2.h:1553
Deprecated. Not supported.
Definition: RFCC26X2.h:1458
Signals the client that the RF driver is about to switch over from another client.
Definition: RFCC26X2.h:1259
RF_PriorityCoex coexPriority
Priority to use for coexistence request.
Definition: RFCC26X2.h:1759
RF_Callback pPowerCb
Definition: RFCC26X2.h:1586
RF_StartType startType
Start type for the start time.
Definition: RFCC26X2.h:1750
RF_Stat RF_getInfo(RF_Handle h, RF_InfoType type, RF_InfoVal *pValue)
Get value for some RF driver parameters.
rfc_radioOp_t RF_Op
Base type for all radio operation commands.
Definition: RFCC26X2.h:1087
High priority. Use this for time-critical commands in synchronous protocols.
Definition: RFCC26X2.h:1117
int16_t RF_CmdHandle
Command handle that is returned by RF_postCmd().
Definition: RFCC26X2.h:1372
General error specifier.
Definition: RFCC26X2.h:1191
Definition: RFCC26X2.h:1684
RF_ClientCallback pClientEventCb
Definition: RFCC26X2.h:1598
void RF_RatConfigCapture_init(RF_RatConfigCapture *channelConfig)
Initialize the configuration structure to be used to set up a RAT capture event.
RF_Stat RF_runDirectCmd(RF_Handle h, uint32_t cmd)
Send any Direct command.
Definition: RFCC26X2.h:1340
uint16_t availRatCh
Available RAT channels (RF_GET_AVAIL_RAT_CH).
Definition: RFCC26X2.h:1470
RF_GlobalEvent
Global RF driver events.
Definition: RFCC26X2.h:1323
RF_Object * RF_Handle
A handle that is returned by to RF_open().
Definition: RFCC26X2.h:1438
rfc_CMD_BLE5_RADIO_SETUP_PA_t ble5_pa
Radio setup command for BLE5 mode with High Gain PA.
Definition: RFCC26X2.h:1220
RF_Priority
Scheduling priority of RF operation commands.
Definition: RFCC26X2.h:1115
RF_PriorityCoex coexPriority
Definition: RFCC26X2.h:1647
Definition: RFCC26X2.h:1622
RF_Stat
Status codes for various RF driver functions.
Definition: RFCC26X2.h:1185
Definition: rf_ble_cmd.h:1644
Definition: RFCC26X2.h:1680
RF_Stat RF_cancelCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode)
Abort/stop/cancel single command in command queue.
Definition: RFCC26X2.h:1794
uint32_t timeout
Definition: RFCC26X2.h:1886
Definition: RFCC26X2.h:1336
uint32_t startTime
Definition: RFCC26X2.h:1640
uint32_t endTime
End time (in RAT tick) of the command or access request.
Definition: RFCC26X2.h:1484
Definition: rf_prop_cmd.h:1013
Use RAT user channel 1.
Definition: RFCC26X2.h:1782
RF_RatCaptureRepetition
Selects the repetition of RF_ratCapture().
Definition: RFCC26X2.h:1820
int8_t power
Definition: RFCC26X2.h:1055
RF_ClientEvent
Client-related RF driver events.
Definition: RFCC26X2.h:1253
RF_RatCaptureSource
Selects the source signal for RF_ratCapture().
Definition: RFCC26X2.h:1791
Provide the client to client switching times.
Definition: RFCC26X2.h:1460
RF request access parameter struct.
Definition: RFCC26X2.h:1767
Bluetooth 5 Radio Setup Command for all PHYs.
Definition: rf_ble_cmd.h:706
int8_t RF_RatHandle
RAT handle that is returned by RF_ratCompare() or RF_ratCapture().
Definition: RFCC26X2.h:1449
Use RAT user channel 2.
Definition: RFCC26X2.h:1783
RF_RatOutputMode mode
The mode the GPO should operate in.
Definition: RFCC26X2.h:1895
RF_CoexOverride bleConnected
Definition: RFCC26X2.h:1172
Default priority. Use value configured by setup command.
Definition: RFCC26X2.h:1132
uint32_t RF_ClientEventMask
Event mask for combining RF_ClientEvent event flags in RF_Params::nClientEventMask.
Definition: RFCC26X2.h:1353
RF_EventMask RF_runScheduleCmd(RF_Handle h, RF_Op *pOp, RF_ScheduleCmdParams *pSchParams, RF_Callback pCb, RF_EventMask bmEvent)
Runs synchronously a (chain of) RF operation(s) for dual or single-mode.
Configure RAT_CHANNEL[x] to interface with RAT_GPO[7].
Definition: RFCC26X2.h:1864
Definition: RFCC26X2.h:1328
Sets the output low independently of any RAT events.
Definition: RFCC26X2.h:1844
TX power configuration entry in a TX power table.
Definition: RFCC26X2.h:1053
Sets the output high independently of any RAT events.
Definition: RFCC26X2.h:1845
uint32_t activityInfo
Definition: RFCC26X2.h:1646
RF_Stat RF_runImmediateCmd(RF_Handle h, uint32_t *pCmdStruct)
Send any Immediate command.
A unified type for radio setup commands of different PHYs.
Definition: RFCC26X2.h:1212
void(* RF_RatCallback)(RF_Handle h, RF_RatHandle rh, RF_EventMask e, uint32_t compareCaptureTime)
Handles events related to the Radio Timer (RAT).
Definition: RFCC26X2.h:1536
RF_TxPowerTable_Value value
PA hardware configuration for that power level.
Definition: RFCC26X2.h:1058
RF_Op * pOp
Definition: RFCC26X2.h:1632
uint32_t nInactivityTimeout
Definition: RFCC26X2.h:1579
Abort the incoming command, letting the ongoing command finish.
Definition: RFCC26X2.h:1671
RF schedule map structure.
Definition: RFCC26X2.h:1491
RF_ScheduleStatus(* RF_SubmitHook)(RF_Cmd *pCmdNew, RF_Cmd *pCmdBg, RF_Cmd *pCmdFg, List_List *pPendQueue, List_List *pDoneQueue)
Handles the queue sorting algorithm when a new command is submitted to the driver from any of the act...
Definition: RFCC26X2.h:1705
RF_ratCompare parameter structure.
Definition: RFCC26X2.h:1883
RF_EventMask pastifg
Definition: RFCC26X2.h:1635
RF_SubmitHook submitHook
Function hook implements the scheduling policy to be executed at the time of RF_scheduleCmd API call...
Definition: RFCC26X2.h:1732
Sets the output low on a RAT event.
Definition: RFCC26X2.h:1842
uint32_t duration
Definition: RFCC26X2.h:1645
Configure RAT_CHANNEL[x] to interface with RAT_GPO[3].
Definition: RFCC26X2.h:1860
RF_CoexOverride bleInitiator
Definition: RFCC26X2.h:1171
rfc_CMD_PROP_RADIO_DIV_SETUP_PA_t prop_div_pa
Radio setup command for PROPRIETARY mode on Sub-1 Ghz with High Gain PA.
Definition: RFCC26X2.h:1222
Assert REQUEST in RX. Override default value configured by setup command.
Definition: RFCC26X2.h:1149
RF_RequestCoex
Behavior for coexistence request signal.
Definition: RFCC26X2.h:1147
Command finished with success.
Definition: RFCC26X2.h:1192
Function finished with success.
Definition: RFCC26X2.h:1194
int8_t RF_TxPowerTable_findPowerLevel(RF_TxPowerTable_Entry table[], RF_TxPowerTable_Value value)
Retrieves a power level in dBm for a given power configuration value.
Definition: RFCC26X2.h:1810
RF_RatHandle RF_ratCompare(RF_Handle rfHandle, RF_RatConfigCompare *channelConfig, RF_RatConfigOutput *ioConfig)
Setup a Radio Timer (RAT) channel in compare mode.
RF_RatHandle channel
RF_RatHandle identifies the channel to be allocated.
Definition: RFCC26X2.h:1885
Abort the ongoing command and run dispatcher again.
Definition: RFCC26X2.h:1672
bool xoscHfAlwaysNeeded
Indicate that the XOSC HF should be turned on by the power driver.
Definition: RFCC26X2.h:1659
Rearm the channel after each capture events.
Definition: RFCC26X2.h:1822
Sets the output high on a RAT event.
Definition: RFCC26X2.h:1841
Configure RAT_CHANNEL[x] to interface with RAT_GPO[1].
Definition: RFCC26X2.h:1858
Show the current RF core power state. 0: Radio OFF, 1: Radio ON.
Definition: RFCC26X2.h:1457
RF_ExecuteAction RF_defaultExecutionPolicy(RF_Cmd *pCmdBg, RF_Cmd *pCmdFg, List_List *pPendQueue, List_List *pDoneQueue, bool bConflict, RF_Cmd *conflictCmd)
Makes a final decision before dispatching a scheduled command.
RF_RequestCoex coexRequest
Definition: RFCC26X2.h:1648
RF_RatSelectChannel
Select the preferred RAT channel through the configuration of RF_ratCompare() or RF_ratCapture().
Definition: RFCC26X2.h:1779
RF scheduler policy.
Definition: RFCC26X2.h:1731
void RF_Params_init(RF_Params *params)
Function to initialize the RF_Params struct to its defaults.
Definition: rf_common_cmd.h:122
Specifies a RF core firmware configuration.
Definition: RFCC26X2.h:1098
uint32_t nID
RF handle identifier.
Definition: RFCC26X2.h:1604
RF_Object * pClient
Definition: RFCC26X2.h:1633
rfc_command_t commandId
Definition: RFCC26X2.h:1213
Definition: RFCC26X2.h:1683
rfc_CMD_PROP_RADIO_SETUP_t prop
Radio setup command for PROPRIETARY mode on 2.4 GHz.
Definition: RFCC26X2.h:1217
rfc_CMD_BLE5_RADIO_SETUP_t ble5
Radio setup command for BLE5 mode.
Definition: RFCC26X2.h:1216
PA configuration value for a certain power level.
Definition: RFCC26X2.h:1023
RF_RatCallback callback
Callback function to be invoked upon a capture event (optional).
Definition: RFCC26X2.h:1872
Definition: RFCC26X2.h:1612
Command not executed because RF driver is busy.
Definition: RFCC26X2.h:1186
RF_Stat RF_ratDisableChannel(RF_Handle rfHandle, RF_RatHandle ratHandle)
Disable a RAT channel.
RF_Callback pErrCb
Definition: RFCC26X2.h:1589
uint8_t hwiPriority
Priority for HWIs belong to the RF driver.
Definition: RFCC26X2.h:1657
RF_TxPowerTable_Value RF_getTxPower(RF_Handle h)
Returns the currently configured transmit power configuration.
uint16_t nPhySwitchingDurationMargin
An additional safety margin to be used to calculate when conflicts shall be evaluated run-time...
Definition: RFCC26X2.h:1596
RF_EventMask bmEvent
Definition: RFCC26X2.h:1634
uint32_t RF_GlobalEventMask
Event mask for combining RF_GlobalEvent event flags in RFCC26XX_HWAttrsV2::globalEventMask.
Definition: RFCC26X2.h:1358
Stores the client&#39;s internal configuration and states.
RF_Priority priority
Access priority.
Definition: RFCC26X2.h:1770
uint64_t RF_EventMask
Data type for events during command execution.
Definition: RFCC26X2.h:1201
void * pScheduleMap
Deprecated. Not supported.
Definition: RFCC26X2.h:1474
RF_PriorityCoex
Priority level for coexistence priority signal.
Definition: RFCC26X2.h:1131
Default request line behavior. Use value configured by setup command.
Definition: RFCC26X2.h:1148
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale