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.

AM5728: GPIO pin configuring

Part Number: AM5728


hai

 is it possible in am5728 to configure the same GPIO pin for both receiving and transmitting modes. If it is possible is there any guide that helps me to achieve that functionality. i mean where the modifications are to be done if i want to configure particular GPIO pin (it may be any GPIO pin).

  • Hi,

    GPIO can be configured as input or output, it doesn't support input and output modes simultaneously. See device TRM, Section 27.4.8 General-Purpose Interface Data Input/Output Capabilities & Table 27-12. General-Purpose Interface Global Initialization:
    "Configure GPIO channels as input or output. GPIO_OE[31:0]OUTPUTEN"

    Best Regards,
    Yordan
  • thanks for the inputs,

    i mean is it possible to configure the same pin for receiving for some time when a switch is pressed and then use the same pin for transmitting when the switch is released(i mean by using external switch is it possible to use same pin for some time as rx and tx for other times)
  • Yes, this is possible.

    Best Regards,
    Yordan
  • thank you for the help.
    may i know the files that are to be modified for achieving( configuring the GPIO ) this.
    how do i know what are pins are being defined by seeing the code i am unable understand the defifnitons systax and values that are used inside the definitions.

    for, Example

    am335x_evm_audio_pins: am335x_evm_audio_pins {

    pinctrl-single,pins = <

    0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rx_dv.mcasp1_aclkx */

    0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_txd3.mcasp1_fsx */

    0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */

    0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */

    >;

    };

    i would like to now what are the values 0x10c, 0x110, 0x108, 0x144 and

    what is the purpose of PULLDOWN( i mean what actually does " PULLDOWN " make effect ..i want it's meaning with respect to effect it is creating like is it for disabling the pin input for a while or enabling the pin)
  • Hi,

    You can achieve this through sysfs entries in /sys/class/gpio/. See:
    www.kernel.org/.../sysfs.txt

    When you export the gpio you can change its direction on the fly with sysfs entries.

    Best Regards,
    Yordan