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.

TMDS62LEVM: Possilbe to do GPIO DeInit and Open-Drain?

Part Number: TMDS62LEVM
Other Parts Discussed in Thread: AM62L

Tool/software:

I have two questions concerning GPIO: 

  1. Is there a way to deinit GPIO setting back to default state?
  2. Is there a way to set an ouptut to open drain mode or this is done automatically when set to I2C mode only?
Thanks,
Brody
  • Hi Brody,

    Is there a way to deinit GPIO setting back to default state?

    Are you asking to do this from a software level? From a Linux perspective, I don't believe the GPIO drivers support this.

    From a register level, this should be possible. All GPIO banks have a clear register to clear the existing context. Refer to the AM62L TRM (Technical Reference Manual): https://www.ti.com/lit/ug/sprujb4/sprujb4.pdf

    Section 14.7.2.2 GPIO of the TRM has the register list of the GPIO peripherals. On AM62L, there are 3 GPIO modules: GPIO0, GPIO2, WKUP_GPIO0. The GPIOs in each module are divided into groups as noted by the x01, x23 etc in the register names.

    All the GPIO groups have a clear register (GPIO_CLR_DATAxx). By writing 1 to a bit, the data register gets cleared of the existing state of GPIO.

    An additional step that can be taken (if required) by resetting the PADCONFIG register. The PADCONFIG register is responsible for configuring pad to be a GPIO. This can be done by writing the reset value to the PADCONFIG register. Refer to 14.2.1.2.2 Pad Configuration PADCONFIG Registers in the AM62L TRM.

    By resetting the PADCONFIG registers, it will disable the input and output buffers that give the pad the ability to receive/transmit data.

    Is there a way to set an ouptut to open drain mode or this is done automatically when set to I2C mode only?

    Again, are you asking to do this at a software level or just a hardware level?

    Thanks,

    Anshu

  • This is at baremetal level using nortos.  We make use of TI SDK drivers in the gpio.c driver provided.  So, would it be possible to have a driver function to deinit the gpio? 

    Thanks,
    Brody Woodard
    Firmware Engineer
    Itron, Inc.

  • Hi Brody,

    Let me loop in the noRTOS expert. Please allow some time for a response.

    Thanks,

    Anshu

  • Hi Brody,

    Is there a way to deinit GPIO setting back to default state?

    In the GPIO_deinit we only disable the Interrupt and clear the interrupt status for the GPIO module. Also the trigger type for GPIO is reset to None.

    Please refer below image.

    If you want to set the reset value for GPIO register, you can do it by directly writing to GPIO register. Please refer below image.

    Regards,

    Tushar

  • Hi Brody,

    Is there a way to set an ouptut to open drain mode or this is done automatically when set to I2C mode only?

    Yes, after making the PAD config changes to configure the pin as I2C mode, Open drain is automatically selected. From software only pinmux settings are required.

    On hardware side, you will need to connect an external pull up register to support I2C Open drain.

    Hope the information helps.

    Regards,

    Tushar

  • Hi Tushar,

    To make sure I understand correctly, when you say "pull up register' you mean pull up resistors?

    Thanks,

    Dazong

  • Hi Dazong,

    when you say "pull up register' you mean pull up resistors?

    Yes, it means pull up resistors. Sorry for the above typo.

    Regards,

    Tushar