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.

AM3352 Controlling Pins

Other Parts Discussed in Thread: AM3352

Hi,

How can you write to pins and set pins on the AM3352 processor? For example, if I were to connect a sensor to one of the pins of the chip, how can I read from the pin? Are there AM3352 specific functions I can use to set/read pins? Where can I learn more about how to configure pins on the AM3352 processor?

Thanks

  • Hi,

    In the example you gave, most likely you will use some of the most common interfaces, like i2c, spi, gpio, etc.. 

    You can find some guides on how to enable/disable & operate with these interfaces in the following wikis: 
    http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_Kernel

    Also you can always use the documentation provided in linux sdk, i.e.: 

    Documentation/spi/spidev.txt

    Documentation/gpio/sysfs.txt

    Documentation/i2c/dev-interface.txt

    You can see how to configure the interfaces in the device tree from Documentation/devicetree/bindings/

    Best Regards, 

    Yordan

  • Hi Yordan,

    I am looking at the documentation for gpio, . Once configuring the gpio interface, what are some functions to program the gpio pins now? Are there examples I can look at to start programming the chip to read data from the sensors? I am looking at the Sitara Technical Reference Manual but dont see any specific functions. I am currently using the Beagle Bone black to program the sensors and a lot of the functions to read the values are available. I am trying to do the same with just the TI chip and sensors.

    Thanks

  • Hi,

    Once you've configured the gpio, you can use the sysfs entries in /sys/class/gpio, see documentation here:
    www.kernel.org/.../sysfs.txt

    You need to export the corresponding gpio (echo X > export). Set its direction as input (echo input > direction) & read the value (cat value). You can also create user space api (a C program working with the files in /sys/class/gpioX/).

    Best Regards,
    Yordan