478 #ifndef ti_drivers_rf__include 479 #define ti_drivers_rf__include 488 #include <ti/drivers/dpl/ClockP.h> 489 #include <ti/drivers/dpl/SemaphoreP.h> 491 #include <ti/devices/DeviceFamily.h> 492 #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) 493 #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h) 494 #include DeviceFamily_constructPath(driverlib/rf_ble_cmd.h) 507 #define RF_EventCmdDone (1<<0) 508 #define RF_EventLastCmdDone (1<<1) 509 #define RF_EventFGCmdDone (1<<2) 510 #define RF_EventLastFGCmdDone (1<<3) 511 #define RF_EventTxDone (1<<4) 512 #define RF_EventTXAck (1<<5) 513 #define RF_EventTxCtrl (1<<6) 514 #define RF_EventTxCtrlAck (1<<7) 515 #define RF_EventTxCtrlAckAck (1<<8) 516 #define RF_EventTxRetrans (1<<9) 517 #define RF_EventTxEntryDone (1<<10) 518 #define RF_EventTxBufferChange (1<<11) 519 #define RF_EventRxOk (1<<16) 520 #define RF_EventRxNOk (1<<17) 521 #define RF_EventRxIgnored (1<<18) 522 #define RF_EventRxEmpty (1<<19) 523 #define RF_EventRxCtrl (1<<20) 524 #define RF_EventRxCtrlAck (1<<21) 525 #define RF_EventRxBufFull (1<<22) 526 #define RF_EventRxEntryDone (1<<23) 527 #define RF_EventDataWritten (1<<24) 528 #define RF_EventNDataWritten (1<<25) 529 #define RF_EventRxAborted (1<<26) 530 #define RF_EventRxCollisionDetected (1<<27) 531 #define RF_EventModulesUnlocked (1<<29) 532 #define RF_EventInternalError (uint32_t)(1<<31) 533 #define RF_EventMdmSoft 0x0000002000000000 543 #define RF_EventCmdCancelled 0x1000000000000000 544 #define RF_EventCmdAborted 0x2000000000000000 545 #define RF_EventCmdStopped 0x4000000000000000 546 #define RF_EventRatCh 0x0800000000000000 547 #define RF_EventPowerUp 0x0400000000000000 548 #define RF_EventError 0x0200000000000000 549 #define RF_EventCmdPreempted 0x0100000000000000 550 #define RF_EventRadioFree 0x0080000000000000 569 #define RF_CTRL_SET_INACTIVITY_TIMEOUT 0 579 #define RF_CTRL_UPDATE_SETUP_CMD 1 585 #define RF_CTRL_SET_POWERUP_DURATION_MARGIN 2 593 #define RF_CTRL_SET_RAT_RTC_ERR_TOL_VAL 3 605 #define RF_CTRL_SET_POWER_MGMT 4 627 #define RF_CTRL_SET_HWI_PRIORITY 5 649 #define RF_CTRL_SET_SWI_PRIORITY 6 656 #define RF_GET_RSSI_ERROR_VAL (-128) 657 #define RF_CMDHANDLE_FLUSH_ALL (-1) 658 #define RF_ALLOC_ERROR (-2) 659 #define RF_SCHEDULE_CMD_ERROR (-3) 660 #define RF_ERROR_RAT_PROG (-255) 661 #define RF_ERROR_INVALID_RFMODE (-256) 662 #define RF_ERROR_CMDFS_SYNTH_PROG (-257) 664 #define RF_NUM_SCHEDULE_MAP_ENTRIES 5 665 #define RF_NUM_SCHEDULE_ACCESS_ENTRIES 2 666 #define RF_NUM_SCHEDULE_COMMAND_ENTRIES (RF_NUM_SCHEDULE_MAP_ENTRIES - RF_NUM_SCHEDULE_ACCESS_ENTRIES) 668 #define RF_SCH_CMD_EXECUTION_TIME_UNKNOWN 0 669 #define RF_RAT_TICKS_PER_US 4 674 #define RF_convertUsToRatTicks(microseconds) \ 675 ((microseconds) * (RF_RAT_TICKS_PER_US)) 680 #define RF_convertMsToRatTicks(milliseconds) \ 681 ((milliseconds) * 1000 * (RF_RAT_TICKS_PER_US)) 686 #define RF_convertRatTicksToUs(ticks) \ 687 ((ticks) / (RF_RAT_TICKS_PER_US)) 692 #define RF_convertRatTicksToMs(ticks) \ 693 ((ticks) / (1000 * (RF_RAT_TICKS_PER_US))) 725 void (*cpePatchFxn)(void);
726 void (*mcePatchFxn)(void);
727 void (*rfePatchFxn)(void);
787 rfc_CMD_BLE5_RADIO_SETUP_t
ble5;
788 rfc_CMD_PROP_RADIO_SETUP_t
prop;
883 #if defined (RF_SINGLEMODE) 884 typedef struct RF_ObjectSingleMode
RF_Object;
886 typedef struct RF_ObjectMultiMode
RF_Object;
892 struct RF_ObjectSingleMode{
895 uint32_t nInactivityTimeout;
898 uint32_t nPowerUpDuration;
901 uint16_t nPowerUpDurationMargin;
910 SemaphoreP_Struct semSync;
911 RF_EventMask
volatile eventSync;
913 RF_EventMask unpendCause;
914 ClockP_Struct clkInactivity;
915 RF_CmdHandle
volatile chLastPosted;
923 struct RF_ObjectMultiMode{
926 uint32_t nInactivityTimeout;
929 uint32_t nPowerUpDuration;
932 uint16_t nPowerUpDurationMargin;
935 void* pClientEventCb;
936 RF_ClientEventMask nClientEventMask;
943 SemaphoreP_Struct semSync;
944 RF_EventMask
volatile eventSync;
946 RF_EventMask unpendCause;
947 ClockP_Struct clkInactivity;
948 ClockP_Struct clkReqAccess;
949 RF_CmdHandle
volatile chLastPosted;
1037 typedef void (*
RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
1313 extern RF_EventMask
RF_pendCmd(RF_Handle h, RF_CmdHandle ch, RF_EventMask bmEvent);
1385 extern RF_Stat
RF_cancelCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
1406 extern RF_Stat
RF_flushCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
1495 extern RF_Op*
RF_getCmdOp(RF_Handle h, RF_CmdHandle cmdHnd);
1524 extern RF_RatHandle
RF_ratCompare(RF_Handle h, rfc_CMD_SET_RAT_CMP_t* pCmdStruct, \
1592 extern RF_Stat
RF_control(RF_Handle h, int8_t ctrl,
void *args);
RF_RatHandle RF_ratCapture(RF_Handle h, uint16_t config, RF_Callback pRatCb)
Setup a Radio Timer (RAT) channel in capture mode.
RF_CmdHandle ch
Command handle (RF_GET_CURR_CMD).
Definition: RF.h:991
Command not executed because RF core is powered down.
Definition: RF.h:757
void(* RF_ClientCallback)(RF_Handle h, RF_ClientEvent event, void *arg)
Handles events related to a driver instance.
Definition: RF.h:1054
RF driver configuration parameters.
Definition: RF.h:1064
uint32_t startTime
Start time window in RAT Time for radio access.
Definition: RF.h:1105
RF_Stat RF_ratDisableChannel(RF_Handle h, RF_RatHandle ratHandle)
Disable a RAT channel.
RF_InfoType
Selects the entry of interest in RF_getInfo().
Definition: RF.h:978
uint16_t nPowerUpDurationMargin
Definition: RF.h:1081
The RF core has been powered up the radio setup has been finished.
Definition: RF.h:822
RF_ClientEvent
Client-related RF driver events.
Definition: RF.h:821
RF_Stat
Status codes for various RF driver functions.
Definition: RF.h:755
uint8_t rfMode
Specifies which PHY modes should be activated. Must be set to RF_MODE_MULTIPLE for dual-mode operatio...
Definition: RF.h:724
RF_Priority priority
Intra client priority.
Definition: RF.h:1097
void(* RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
Handles events related to RF command execution.
Definition: RF.h:1037
uint8_t swiHwPriority
Priority for HW SWI. Used for all RAT channel callbacks.
Definition: RF.h:859
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...
RF_ClientEventMask nClientEventMask
Definition: RF.h:1089
RF schedule map entry structure.
Definition: RF.h:998
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's command queue and returns a command handle...
Command finished with success.
Definition: RF.h:762
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.
Command not executed because RF driver is busy.
Definition: RF.h:756
Highest priority. Only use this for urgent commands.
Definition: RF.h:742
RF_Stat RF_runImmediateCmd(RF_Handle h, uint32_t *pCmdStruct)
Send any Immediate command.
uint64_t RF_EventMask
Data type for events during command execution.
Definition: RF.h:771
uint32_t RF_ClientEventMask
Event mask for combining RF_ClientEvent event flags in RF_Params::nClientEventMask.
Definition: RF.h:833
uint32_t nPowerUpDuration
Definition: RF.h:1068
Command successfully scheduled for execution.
Definition: RF.h:763
void RF_close(RF_Handle h)
Close client connection to RF driver.
Cmd is found in the pool but was already ended.
Definition: RF.h:760
uint8_t hwiCpe0Priority
Priority for INT_RFC_CPE_0 interrupt.
Definition: RF.h:856
RF_Handle RF_open(RF_Object *pObj, RF_Mode *pRfMode, RF_RadioSetup *pOpSetup, RF_Params *params)
Creates a a new client instance of the RF driver.
rfc_CMD_PROP_RADIO_DIV_SETUP_t prop_div
Radio setup command for PROPRIETARY mode on Sub-1 Ghz.
Definition: RF.h:789
RF_Stat RF_ratHwOutput(RF_Handle h, uint16_t config)
Setup RAT HW output. Note radio needs to be ON and and the selected RAT channel should be configured ...
uint32_t RF_getCurrentTime(void)
Return current radio timer value.
Signals the client that the RF driver is about to switch over from another client.
Definition: RF.h:827
Stores output parameters for RF_getInfo().
Definition: RF.h:990
RF_Object * RF_Handle
A handle that is returned by to RF_open().
Definition: RF.h:961
RF_Handle pClient
Pointer to client object.
Definition: RF.h:999
#define RF_NUM_SCHEDULE_ACCESS_ENTRIES
Number of access request entries.
Definition: RF.h:665
RF Hardware attributes.
Definition: RF.h:855
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...
RF_Priority priority
Priority of the command or access request.
Definition: RF.h:1002
rfc_radioOp_t RF_Op
Base type for all radio operation commands.
Definition: RF.h:712
Default priority. Use this in single-client applications.
Definition: RF.h:744
int8_t RF_getRssi(RF_Handle h)
Get RSSI value.
bool bRadioState
Current RF core power state (RF_GET_RADIO_STATE).
Definition: RF.h:993
uint32_t duration
Radio access duration in RAT Ticks requested by the client.
Definition: RF.h:1104
void RF_yield(RF_Handle h)
Signal that radio client is not going to issue more commands in a while.
#define RF_NUM_SCHEDULE_COMMAND_ENTRIES
Number of scheduled command entries.
Definition: RF.h:666
uint32_t startTime
Start time (in RAT tick) of the command or access request.
Definition: RF.h:1000
uint32_t endTime
End time in RAT Ticks for the radio command.
Definition: RF.h:1096
Create a bitmask showing available RAT channels.
Definition: RF.h:980
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_Stat RF_cancelCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode)
Abort/stop/cancel single command in command queue.
RF schedule command parameter struct RF schedule command parameters are used with the RF_scheduleCmd(...
Definition: RF.h:1095
RF_Callback pPowerCb
Definition: RF.h:1072
bool bIeeeBgCmd
IEEE 15.4 background command indication. 0: FG cmd, 1: BG cmd.
Definition: RF.h:1098
int16_t RF_CmdHandle
Command handle that is returned by RF_postCmd().
Definition: RF.h:847
RF_ClientCallback pClientEventCb
Definition: RF.h:1086
uint16_t availRatCh
Available RAT channels (RF_GET_AVAIL_RAT_CH).
Definition: RF.h:992
uint8_t swiCpe0Priority
Priority for CPE_0 SWI.
Definition: RF.h:858
RF_Op * RF_getCmdOp(RF_Handle h, RF_CmdHandle cmdHnd)
Get command structure pointer.
General error specifier.
Definition: RF.h:761
bool bPowerUpXOSC
Definition: RF.h:1076
uint32_t endTime
End time (in RAT tick) of the command or access request.
Definition: RF.h:1001
rfc_CMD_RADIO_SETUP_t common
Radio setup command for BLE and IEEE modes.
Definition: RF.h:786
int8_t RF_RatHandle
RAT handle that is returned by RF_ratCompare() or RF_ratCapture().
Definition: RF.h:972
RF request access parameter struct RF request access command parameters are used with the RF_requestA...
Definition: RF.h:1103
RF_Stat RF_getInfo(RF_Handle h, RF_InfoType type, RF_InfoVal *pValue)
Get value for some RF driver parameters.
Command finished with an error.
Definition: RF.h:758
Provide a timetable of all scheduled commands.
Definition: RF.h:982
RF_Priority
Scheduling priority of RF operation commands.
Definition: RF.h:741
Function was called with an invalid parameter.
Definition: RF.h:759
High priority. Use this for time-critical commands in synchronous protocols.
Definition: RF.h:743
RF_RatHandle RF_ratCompare(RF_Handle h, rfc_CMD_SET_RAT_CMP_t *pCmdStruct, uint32_t compareTime, RF_Callback pRatCb)
Setup a Radio Timer (RAT) channel in compare mode.
A unified type for radio setup commands of different PHYs.
Definition: RF.h:782
uint32_t nInactivityTimeout
Definition: RF.h:1065
RF schedule map structure.
Definition: RF.h:1006
RF_Stat RF_requestAccess(RF_Handle h, RF_AccessParams *pParams)
Request radio access.
RF_Stat RF_runDirectCmd(RF_Handle h, uint32_t cmd)
Send any Direct command.
Retrieve a command handle of the current command.
Definition: RF.h:979
Specifies a RF core firmware configuration.
Definition: RF.h:723
rfc_command_t commandId
Definition: RF.h:783
rfc_CMD_PROP_RADIO_SETUP_t prop
Radio setup command for PROPRIETARY mode on 2.4 GHz.
Definition: RF.h:788
rfc_CMD_BLE5_RADIO_SETUP_t ble5
Radio setup command for BLE5 mode.
Definition: RF.h:787
Function finished with success.
Definition: RF.h:764
RF_Callback pErrCb
Callback function for driver error events.
Definition: RF.h:1075
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.
RF_Stat RF_control(RF_Handle h, int8_t ctrl, void *args)
Set RF control parameters.
uint8_t hwiHwPriority
Priority for INT_RFC_HW_COMB interrupt.
Definition: RF.h:857
void RF_Params_init(RF_Params *params)
Function to initialize the RF_Params struct to its defaults.
Stores the client's internal confguration and states.
Show the current RF core power state. 0: Radio OFF, 1: Radio ON.
Definition: RF.h:981
RF_Priority priority
Access priority.
Definition: RF.h:1106
void * pScheduleMap
Pointer to scheduling map (RF_GET_SCHEDULE_MAP).
Definition: RF.h:994