Pullup in Linux

Discussion in 'UDOO 101' started by cirrus, Jun 8, 2014.

  1. cirrus

    cirrus New Member

    Joined:
    Jun 7, 2014
    Messages:
    3
    Likes Received:
    0
    Hi All,

    I'm running a quad with udoobuntu.

    I'm trying to wire a test switch (it's a simple two pin switch) to two GPIO pins. Both have to be GPIO pins (I'm later going to try a matrix).

    Basically:

    Set gpio 40 to output 0
    Set gpio 3 to input with pullup

    Connect one switch pin to gpio 40 and another to gpio 3.

    I'd then cat /sys/class/gpio/gpio3/value and expect 1 when switch is not pressed, expect 0 when it is pressed.

    How can I activate the pullup resistor in gpio 3 via linux?

    Thank you
     
  2. ekirei

    ekirei Administrator

    Joined:
    Jun 14, 2013
    Messages:
    78
    Likes Received:
    3
    Hi cirrus,

    to set a pullup to a pin of the i.Mx6 Processor of UDOO you need to modifiy and recompile the kernel.

    You need to modify the file:

    <KERNEL_ROOT>/arch/arm/mach_mx6/board_mx6qd_seco_UDOO.h (for QUAD)
    or
    <KERNEL_ROOT>/arch/arm/mach_mx6/board_mx6sdl_seco_UDOO.h (for DUAL)

    adding a custom macro for the pin you want.
    You can find some Pinmuxing information in the "i.MX6 Pinmuxing" section of the Starting Manual downloadable here :
    http://www.udoo.org/downloads/#tab5


    Otherwise you can use the Pin from Arduino side which already have input pullups
     

Share This Page