This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1352P: Quesiton on how to understand rfDriverCallbackAntennaSwitching function, e.g. in rfCarrierWave example

Part Number: CC1352P
Other Parts Discussed in Thread: SYSCONFIG

Dear TI Expert,

  I am new to Simplelink RF Driver programming, forgive me if I am asking stupid questions.  In the example project of rfCarrierWave, call back function rfDriverCallbackAntennaSwitching (...) is generated by sysconfig (bty, i cannot see the call back function name in sysconfig).  I do not have a idea how does the main program enter this callback function, i mean i cannot see how a interrupt is related to this call back function as in ti_driver_config.c file.

  I  have read RF user guide doc, and understand events tend to occur when a command ends. So here, how can i find hints and understand the antenna switching case. (Does the event of antenna switch change the state (GPIO pin control) would call back the  rfDriverCallbackAntennaSwitching function? If so , how should one usually check this prodcedure?)

  Hope someone can kindly shed some light on it or share some experience on this.

  Thanks in advance.

Yuanchen Zhu

  • Hi Yuanchen,

    Thank you for your question!

    The RF driver serves some global events like, EventRadioPowerDown, EventRadioSetup. The global event mask can be set in sysconfig. When these events happen, a Global callback function is called. The Antenna switching callback is also called during these global events. 

    If you click on the tiny question mark next to Global Callback Function on sysconfig, this shows the documentation global events and callback.

     The function rfDriverCallbackAntennaSwitching defined in ti_drivers_config.h, performs the action of setting up the antenna switch that is connected to GPIO 28,29, 30 based on the radio event. At RF_GlobalEventRadioSetup, it sets up according to the phy selection, and at the RF_GlobalEventRadioPowerDown, it switches off all paths to the switch.

    Regards,

    Sid  
     

  • Hello, Sid 

      Thanks for your explanation. It really makes sense to me now. One further quesiton, how should we understand other masks types, e.g. GlobalEventCmdStart, CmdStop... What's its difference to GlobalEventRadioSetup/ RadioPowerDown, respectively?

    Thanks.

    Yuanchen Zhu

     

  • Hi Yuanchen,

    These events are defined in the RFCC26X2.h header file. 

     *
     * \sa #RF_GlobalCallback
     */
    typedef enum {
        RF_GlobalEventRadioSetup     = (1 << 0),             ///< The RF core is being reconfigured through a setup command.
                                                             ///< The \a arg argument is a pointer to the setup command.
                                                             ///< HWI context.
    
        RF_GlobalEventRadioPowerDown = (1 << 1),             ///< The RF core is being powered down.
                                                             ///< The \a arg argument is empty.
                                                             ///< SWI context.
    
        RF_GlobalEventInit           = (1 << 2),             ///< RF_open() is called for the first time (number of registered clients changes from 0 to 1).
                                                             ///< The \a arg argument is empty.
                                                             ///< Task context.
    
        RF_GlobalEventCmdStart       = (1 << 3),             ///< A command chain is being dispatched to the radio.
                                                             ///< The \a arg argument is a pointer to the current command.
                                                             ///< HWI context.
    
        RF_GlobalEventCmdStop        = (1 << 4),             ///< Command termination event is handled.
                                                             ///< The \a arg argument is a pointer to the current command.
                                                             ///< HWI context.
    
        RF_GlobalEventCoexControl    = (1 << 5),             ///< Change to coex configuration is requested
                                                             ///< The \a arg argument is pointer to at least 8-bit wide int with value 1=enable, or 0=disable
                                                             ///< Task/HWI context.
    
        RF_GlobalEventTempNotifyFail  = (1 << 6),            ///< Registration of temperature notification was unsuccessful
                                                             ///< (failure returned from temperature driver)
                                                             ///< The \a arg argument is empty.
                                                             ///< HWI context
    
    } RF_GlobalEvent;

    These are the events available to trigger the global callback. 

    Regards,

    Sid

  • Thanks for pointing out, Sid.

    Yuanchen