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.

How to control the GPIO of expansion bank J14, J15

Dear Community,

I need to control a external system by C6748 LCDK board.

I am thinking to use GPIO pins of Expansion bank of J14 and J15 of C6748 LCDK board?    

 

When I am trying to use GPIO Expansion pins of the board (GPIO8-12 or GPIO8-10??)

GPIOBank8Pin16PinMuxSetup();

  It shows the following error .

Description Resource Path Location Type unresolved symbol GPIOBank8Pin16PinMuxSetup, first referenced in ./main.obj gpio_c674x_c6748_lcdkC6748    C/C++ Problem.

How can I use GPIO expansion pins??

With regards,

  • Hi Amlan,

    Able to understand the code (PINMUX) in this link which I posted ?


    It has some PINMUX for various GPIOs.

    So that you can add your own function to do the PINMUX for any GPIO.

    For ex, I give you the code for GPIO8-10, you please understand and change it for GPIO8-12

    #include "hw_types.h"
    #include "hw_syscfg0_OMAPL138.h"
    
    /* Pin Multiplexing bit mask to select GP8[10] pin. */
    #define PINMUX18_GPIO8_10_ENABLE (SYSCFG_PINMUX18_PINMUX18_31_28_GPIO8_10 << \
    SYSCFG_PINMUX18_PINMUX18_31_28_SHIFT)
    
    
    void GPIOBank8Pin10PinMuxSetup(void)
    {
    unsigned int savePinmux = 0;
    
    /*
    ** Clearing the bit in context and retaining the other bit values
    ** in PINMUX10 register.
    */
    savePinmux = (HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(18)) &
    ~(SYSCFG_PINMUX18_PINMUX18_31_28));
    
    /* Setting the pins corresponding to GP8[10] in PINMUX10 register.*/
    HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(18)) =
    (PINMUX18_GPIO8_10_ENABLE | savePinmux);
    
    }
    
    int main(void)
    {
    /* The Local PSC number for GPIO is 3. GPIO belongs to PSC1 module.*/
    PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON,
    PSC_MDCTL_NEXT_ENABLE);
    
    /* Initializes the UART instance.*/
    UARTStdioInit();
    
    /* Pin Multiplexing of pin 10 of GPIO Bank 8.*/
    GPIOBank8Pin10PinMuxSetup();
    
    
    GPIODirModeSet(SOC_GPIO_0_REGS, 139, GPIO_DIR_OUTPUT);
    
    while(1)
    {
    GPIOPinWrite(SOC_GPIO_0_REGS, 139, GPIO_PIN_LOW);
    
    Delay(1000000);
    
    GPIOPinWrite(SOC_GPIO_0_REGS, 139, GPIO_PIN_HIGH);
    
    Delay(1000000);
    
    }
    
    return 0;
    }
    

    Can you please try this code and let me know ?