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.

PDK & GPIO: Configure as Output

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Tool/software:

Hi,

we want to toggle GPIO pin 50 on the TDA4VH via PDK. As far as we understood we therefore need to configure the GPIO module.

The configuration we have so far:

enum Pins { GPIO0_50 = 0U, PIN_MAX };
uint32_t gpioBaseAddr[PIN_MAX] = { CSL_WKUP_GPIO0_BASE };
GPIO_PinConfig gpioPinConfigs[PIN_MAX] = {
    GPIO_DEVICE_CONFIG(1U, 18U) /* 50 = port 1, pin 18 */
    | GPIO_CFG_IN_INT_NONE | GPIO_CFG_OUTPUT
}
GPIO_CallbackFxn gpioCallbackFunctions[PIN_MAX] = { NULL };
GPIO_v0_Config GPIO_v0_config = {
    gpioPinConfigs,
    gpioCallbackFunctions,
    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
    0x8U /* R5F */
}

static void Board_initGPIO(void)
{
    GPIO_v0_HwAttrs gpio_cfg;

    for (int looper = 0U; looper < PIN_MAX; looper++)
    {
        GPIO_socGetInitCfg(looper, &gpio_cfg);
        gpio_cfg.baseAddr = gpioBaseAddr[looper];
        GPIO_socSetInitCfg(looper, &gpio_cfg);
    }
}

void main()
{
    Board_initGPIO();
    GPIO_init();
    GPIO_write(GPIO0_50, 0U);
}

Since it currently doesn't seem to work: Did we miss anything in the configuration?

Thanks,
Thomas