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.

TMDSLCDK138: How to set 2 GPIO callbacks

Part Number: TMDSLCDK138

Hi,

my customer  has been checking sample program in PROCESSOR-SDK-RTOS-OMAPL138 (Ver6.0.0.7) on TMDSLCDK138.

The project is GPIO_LedBlink_lcdkOMAPL138_c674xTestProject.

GPIO pins:

  SD card insertion / extraction information: port 0, pin 64

  switch: port 0, pin 37

Setup Steps:

  1. Set PinConfig in the order of SD card and then switch. (Both setting is BOTH_EDGE and INPUT)

  2. Set callback function for each input.

  3. Callback function is called when inserting / removing SD card.

  4. Callback function is called when SD card is inserted / removed after switch is pressed.

When two GPIO callbacks are set, if one callback does not occur, the other callback does not occur.

But they want to call each callback function when inserting / removing the SD card / pressing the switch.

Could you tell us how to setup it?

Best Regards,

  • Ohhashi-san,

    I created a test project in the past for a thread with a similar issue. The project enables interrupts for pins 141 and 108 and configures callbacks for each pin. I've attached it below. Can the customer use it as reference? 

    GPIO_LedBlink_lcdkOMAPL138_c674xTestProject_Sahin.zip

    They will need to add USER_LED2 to GPIO_board.h and rebuild the GPIO driver. 

    /* ON Board LED pins which are connected to GPIO pins. */
    typedef enum GPIO_LED {
        USER_LED0 = 0,
        USER_LED1
    }GPIO_LED;

    Please let me know if you have any questions.

    Regards,
    Sahin

  • Sahin-san,

    Thank you for your quick response. We will check the thread and the program.

    Best Regards,

  • I'm glad to help! Please let me know if you have any questions or run into any issues.

    Regards,
    Sahin

  • Sahin-san,

    my customer has additional question.

    They would like to know how to interrupt each time at the edge (change point) with different GPIO inputs.

    We would be grateful if you could have a sample program.

    Best Regards,

    M.Ohhashi

  • Ohhashi-san,

    To generate an interrupt at both edges, change "GPIO_CFG_IN_INT_RISING" to "GPIO_CFG_IN_INT_BOTH_EDGES" in the following code from GPIO_board.c.

    /* GPIO Driver board specific pin configuration structure */
    GPIO_PinConfig gpioPinConfigs[] = {
    
            GPIO_DEVICE_CONFIG(GPIO_LED0_PORT_NUM, 140U) | //141: GP8[12]
            GPIO_CFG_IN_INT_RISING | GPIO_CFG_OUTPUT,
    
            /* Output pin */
            GPIO_DEVICE_CONFIG(GPIO_LED1_PORT_NUM, 108U) | //109: GP6[12]
            GPIO_CFG_OUTPUT,
    
            /* Input pin with interrupt enabled */
            GPIO_DEVICE_CONFIG(GPIO_LED0_PORT_NUM, 107U) | //108: GP6[11]
            GPIO_CFG_IN_INT_RISING | GPIO_CFG_OUTPUT
    
    };

    Please let me know if you have any other questions.

    Regards,
    Sahin