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.

RTOS/LAUNCHXL-CC1352R1: CC1352R1

Part Number: LAUNCHXL-CC1352R1


Tool/software: TI-RTOS

I have CC1352R1 launchpad. I try using hwi for gpio(button0 or button1) like written in TI-RTOS Kernel (SYS/BIOS) User's Guide, but it's not work:

Hwi_Params_init(&hwiParams);
hwiParams.arg = 0;
hwiParams.enableInt = true;
hwiHndl = Hwi_create(14, (Hwi_FuncPtr)hwiFxn1, &hwiParams, NULL);

If use approach from pin or gpio interrupt examples, it's working.

  • Hi Anton,

    Why do you want to setup the GPIO ISR like this instead of using the designated drivers? As all of the driver support available for the device depends on the GPIO/PIN driver to be able to control this, you should not try to override this by setting up your own ISR if you want to leverage the TI Drivers.

    Furthermore, you are registering interrupt 14, which is "Pending service call" and not the GPIO edge interrupt which is 16.
  • Hi!

    I just start learning ti-rtos and i was thought that it's be right that hwi should be used for any interrupt. And like simplest example of using hwi i have been used gpio interrupt.
    I used event id number for GPIO pin 14, becouse i was can't find interrupt number and numbers more than 14 led to looping in Hwi_create function.
    What is id number must be used in call of Hwi_create(), where i can see it?
    In which cases to use hwi and in which not?

    Best regards,

    Anton

  • Hi Anton,

    To answer the last question first, "When to use Hwi and when to not", this depends on what you need to do.
    If you for example use the TI provided drivers for using the available hardware, then you would not need to worry about this at all as the driver takes care of it. If you decide to write your own driver for some reason (the UART driver might not behave as you want it to do or you have some special functionality you need to implement), you would want to setup the Hwi yourself.

    the file hw_ints.h (found in C:\ti\simplelink_cc13x2_sdk_2_30_00_45\source\ti\devices\cc13x2_cc26x2_v1\inc) contains defines for the available interrupts.
  • Hi, M-W! Thank you for the answers!

    In case of hooks for gpio interrupts needed, will they work without using hwi?

    How to set priority for gpio interrupts then?

    And for example if I still need hwi for gpio, is it possible?

    If yes, then how?

    Best Regards,

    Anton

  • Hi Anton,

    If you setup an interrupt using the PIN or GPIO driver, the driver itself will register the Hwi, you supply the callback function/hook.

    You can set the interrupt priority for the pins in the driver configuration struct in the the board file.