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 684 typedef rfc_radioOp_t RF_Op; 697 void (*cpePatchFxn)(void);
698 void (*mcePatchFxn)(void);
699 void (*rfePatchFxn)(void);
759 rfc_CMD_BLE5_RADIO_SETUP_t
ble5;
760 rfc_CMD_PROP_RADIO_SETUP_t
prop;
855 #if defined (RF_SINGLEMODE) 856 typedef struct RF_ObjectSingleMode
RF_Object;
858 typedef struct RF_ObjectMultiMode
RF_Object;
864 struct RF_ObjectSingleMode{
867 uint32_t nInactivityTimeout;
870 uint32_t nPowerUpDuration;
873 uint16_t nPowerUpDurationMargin;
882 SemaphoreP_Struct semSync;
883 RF_EventMask
volatile eventSync;
885 RF_EventMask unpendCause;
886 ClockP_Struct clkInactivity;
887 RF_CmdHandle
volatile chLastPosted;
895 struct RF_ObjectMultiMode{
898 uint32_t nInactivityTimeout;
901 uint32_t nPowerUpDuration;
904 uint16_t nPowerUpDurationMargin;
907 void* pClientEventCb;
908 RF_ClientEventMask nClientEventMask;
915 SemaphoreP_Struct semSync;
916 RF_EventMask
volatile eventSync;
918 RF_EventMask unpendCause;
919 ClockP_Struct clkInactivity;
920 ClockP_Struct clkReqAccess;
921 RF_CmdHandle
volatile chLastPosted;
1009 typedef void (*
RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
1285 extern RF_EventMask
RF_pendCmd(RF_Handle h, RF_CmdHandle ch, RF_EventMask bmEvent);
1357 extern RF_Stat
RF_cancelCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
1378 extern RF_Stat
RF_flushCmd(RF_Handle h, RF_CmdHandle ch, uint8_t mode);
1496 extern RF_RatHandle
RF_ratCompare(RF_Handle h, rfc_CMD_SET_RAT_CMP_t* pCmdStruct, \
1564 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:963
Command not executed because RF core is powered down.
Definition: RF.h:729
void(* RF_ClientCallback)(RF_Handle h, RF_ClientEvent event, void *arg)
Handles events related to a driver instance.
Definition: RF.h:1026
RF driver configuration parameters.
Definition: RF.h:1036
uint32_t startTime
Start time window in RAT Time for radio access.
Definition: RF.h:1077
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:950
uint16_t nPowerUpDurationMargin
Definition: RF.h:1053
The RF core has been powered up the radio setup has been finished.
Definition: RF.h:794
RF_ClientEvent
Client-related RF driver events.
Definition: RF.h:793
RF_Stat
Status codes for various RF driver functions.
Definition: RF.h:727
uint8_t rfMode
Specifies which PHY modes should be activated. Must be set to RF_MODE_MULTIPLE for dual-mode operatio...
Definition: RF.h:696
RF_Priority priority
Intra client priority.
Definition: RF.h:1069
void(* RF_Callback)(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
Handles events related to RF command execution.
Definition: RF.h:1009
uint8_t swiHwPriority
Priority for HW SWI. Used for all RAT channel callbacks.
Definition: RF.h:831
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:1061
RF schedule map entry structure.
Definition: RF.h:970
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:734
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:728
Highest priority. Only use this for urgent commands.
Definition: RF.h:714
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:743
uint32_t RF_ClientEventMask
Event mask for combining RF_ClientEvent event flags in RF_Params::nClientEventMask.
Definition: RF.h:805
uint32_t nPowerUpDuration
Definition: RF.h:1040
Command successfully scheduled for execution.
Definition: RF.h:735
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:732
uint8_t hwiCpe0Priority
Priority for INT_RFC_CPE_0 interrupt.
Definition: RF.h:828
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:761
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:799
Stores output parameters for RF_getInfo().
Definition: RF.h:962
RF_Object * RF_Handle
A handle that is returned by to RF_open().
Definition: RF.h:933
RF_Handle pClient
Pointer to client object.
Definition: RF.h:971
#define RF_NUM_SCHEDULE_ACCESS_ENTRIES
Number of access request entries.
Definition: RF.h:665
RF Hardware attributes.
Definition: RF.h:827
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:974
rfc_radioOp_t RF_Op
Base type for all radio operation commands.
Definition: RF.h:684
Default priority. Use this in single-client applications.
Definition: RF.h:716
int8_t RF_getRssi(RF_Handle h)
Get RSSI value.
bool bRadioState
Current RF core power state (RF_GET_RADIO_STATE).
Definition: RF.h:965
uint32_t duration
Radio access duration in RAT Ticks requested by the client.
Definition: RF.h:1076
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:972
uint32_t endTime
End time in RAT Ticks for the radio command.
Definition: RF.h:1068
Create a bitmask showing available RAT channels.
Definition: RF.h:952
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:1067
RF_Callback pPowerCb
Definition: RF.h:1044
bool bIeeeBgCmd
IEEE 15.4 background command indication. 0: FG cmd, 1: BG cmd.
Definition: RF.h:1070
int16_t RF_CmdHandle
Command handle that is returned by RF_postCmd().
Definition: RF.h:819
RF_ClientCallback pClientEventCb
Definition: RF.h:1058
uint16_t availRatCh
Available RAT channels (RF_GET_AVAIL_RAT_CH).
Definition: RF.h:964
uint8_t swiCpe0Priority
Priority for CPE_0 SWI.
Definition: RF.h:830
RF_Op * RF_getCmdOp(RF_Handle h, RF_CmdHandle cmdHnd)
Get command structure pointer.
General error specifier.
Definition: RF.h:733
bool bPowerUpXOSC
Definition: RF.h:1048
uint32_t endTime
End time (in RAT tick) of the command or access request.
Definition: RF.h:973
rfc_CMD_RADIO_SETUP_t common
Radio setup command for BLE and IEEE modes.
Definition: RF.h:758
int8_t RF_RatHandle
RAT handle that is returned by RF_ratCompare() or RF_ratCapture().
Definition: RF.h:944
RF request access parameter struct RF request access command parameters are used with the RF_requestA...
Definition: RF.h:1075
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:730
Provide a timetable of all scheduled commands.
Definition: RF.h:954
RF_Priority
Scheduling priority of RF operation commands.
Definition: RF.h:713
Function was called with an invalid parameter.
Definition: RF.h:731
High priority. Use this for time-critical commands in synchronous protocols.
Definition: RF.h:715
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:754
uint32_t nInactivityTimeout
Definition: RF.h:1037
RF schedule map structure.
Definition: RF.h:978
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:951
Specifies a RF core firmware configuration.
Definition: RF.h:695
rfc_command_t commandId
Definition: RF.h:755
rfc_CMD_PROP_RADIO_SETUP_t prop
Radio setup command for PROPRIETARY mode on 2.4 GHz.
Definition: RF.h:760
rfc_CMD_BLE5_RADIO_SETUP_t ble5
Radio setup command for BLE5 mode.
Definition: RF.h:759
Function finished with success.
Definition: RF.h:736
RF_Callback pErrCb
Callback function for driver error events.
Definition: RF.h:1047
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:829
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:953
RF_Priority priority
Access priority.
Definition: RF.h:1078
void * pScheduleMap
Pointer to scheduling map (RF_GET_SCHEDULE_MAP).
Definition: RF.h:966