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.

AM64x Sitara Sysconfig gPinMuxMainDomainCfg and GPIO banks

Other Parts Discussed in Thread: SYSCONFIG

Good morning,
I have yet another question concerning GPIO.

What I understand:
*******************************************************************************************************************************************************
The pins on our board are currently configured using SysConfig which generates a map of type gPinMuxMainDomainCfg with pin name
(which is the pins offset defined in TI_sdk/mcu_plus_sdk_am64x/source/drivers/pinmux/am64x_am243x/pinmux.h in enum Pinmux_MainOffsets)
as key and settings (PIN_MODE, pull direction, input/output) as data.

During initialization a function Pinmux_Init is called which calls itself Pinmux_Config once with domain main and once with domain mcu.
Then inside Pinmux_Configgiven a domain (main or mcu). Then the base address is calculated from the domain.

*******************************************************************************************************************************************************

What I don't understand
*******************************************************************************************************************************************************
Now it seems that each single pin can somehow be accessed from a domain dependant base address and the pin offset given in enum Pinmux_MainOffsets.
This includes GPIO-pins.
But at the same time, GPIO-pins are accessed only as a bit position (whcih makes sense as they only have a digital value) from calculating bank register index and pin mask
from GPIO module base address which points to a CSL_GpioRegs struct defined in TI_sdk/mcu_plus_sdk_am64x/source/drivers/gpio/v0/cslr_gpio.h.

And my problem here is that I don't see how the Sysconfig approach with registers for each pin and the cslr_gpio.h approach with registers only for banks and pins as bit values fit together.

*******************************************************************************************************************************************************
Thank you for your time and trouble.


Best regards

Philip.

  • Ah, the pin offset in enum Pinmux_MainOffsets is probably the pin number used in gpio.h to calculate the bank and pin mask.
    Is that correct?
    I guess I will use it for now like that, hope it works.

  • Hi Philip,

    What the example.syscfg does is to map the actual GPIO pins to a specific name, like GPIO1_43 to GPIO_PUSH_BUTTON in gpio_input_interrupt_am64x-evm_r5fss0-1_norto, generate the  ti_pinmux_config.c for pinmux and generate the ti_drivers_config.h for the following defines for GPIO1_43:

    /* GPIO PIN Macros */
    #define GPIO_PUSH_BUTTON_BASE_ADDR (CSL_GPIO1_BASE)
    #define GPIO_PUSH_BUTTON_PIN (43)
    #define GPIO_PUSH_BUTTON_DIR (GPIO_DIRECTION_INPUT)
    #define GPIO_PUSH_BUTTON_TRIG_TYPE (GPIO_TRIG_TYPE_RISE_EDGE)
    #define CONFIG_GPIO_NUM_INSTANCES (1U)

    They will be used later in the gpio_input_interrupt_main() in gpio_input_interrupt.c for initialization and configuration.

    Best regards,

    Ming