Changes between Version 1 and Version 2 of gateworks_linux_test_commands


Ignore:
Timestamp:
02/27/2018 04:22:16 PM (7 years ago)
Author:
Tim Harvey
Comment:

updated page: formatting changes and removed deprecated gpioctl / madwifi details

Legend:

Unmodified
Added
Removed
Modified
  • gateworks_linux_test_commands

    v1 v2  
    22Following is a list of commands that are available in the BSP from Gateworks that can be used in order to test the functionality of the product. Users can use these commands to further the functionality of there application.
    33
     4
     5[=#pci]
    46== PCI ==
     7See also:
     8 * [wiki:newport/PCIe]
     9 * [wiki:ventana/PCIe]
     10
    511=== Find available devices on the PCI Bus ===
    6 {{{
     12{{{#!bash
    713lspci -v
    814}}}
     
    1016== USB ==
    1117=== Find available devices on the USB Bus ===
    12 {{{
     18{{{#!bash
    1319lsusb -v
    1420}}}
    1521
    1622
    17 === Manual Bring up madwifi Access Point ===
    18 This should only be used to bring up access point manually, please use webgui to configure more advanced functions and be persistent across reboots:
    19 
    20 {{{
    21 wlanconfig ath0 create wlandev wifi0 wlanmode ap
    22 iwconfig ath0 essid test
    23 ifconfig ath0 up
    24 }}}
    25 
     23[=#rtc]
    2624== RTC ==
    2725=== Read Time from RTC ===
    28 {{{
     26{{{#!bash
    2927hwclock -r
    3028}}}
    3129
    3230=== Write current Time to RTC ===
    33 {{{
     31{{{#!bash
    3432hwclock -w
    3533}}}
    3634
     35
     36[=#hwmon]
    3737== HWMON ==
    3838=== Read Voltage ===
    3939Different voltages can be read from the board, just change in0 to any of in0 - in12[[BR]]
    4040The voltages read are current voltage * 1000
    41 {{{
     41{{{#!bash
    4242cat /sys/class/hwmon/hwmon0/device/in0_label
    4343cat /sys/class/hwmon/hwmon0/device/in0_input
     
    4646=== Read Temperature ===
    4747The temp read is current temp * 10
    48 {{{
     48{{{#!bash
    4949cat /sys/class/hwmon/hwmon0/device/temp0_input
    5050}}}
     
    5454=== Read Current Setpoint ===
    5555The setpoint read is current setpoint * 10
    56 {{{
     56{{{#!bash
    5757cat /sys/class/hwmon/hwmon0/device/fan0_point0
    5858}}}
     
    6363}}}
    6464
     65
     66[=#gpio]
    6567== GPIO ==
     68
     69See also:
     70 * [wiki:gpio]
     71 * [wiki:OpenWrt/gpio]
     72
    6673=== Read GPIO ===
    67 Read the state of a GPIO Pin where "x" is the gpio number
    68 {{{
    69 gpioctl get x
     74See a list of currentl used GPIO's:
     75{{{#!bash
     76cat /sys/kernel/debug/gpio
     77}}}
     78
     79=== Export A GPIO for user control ===
     80{{{#!bash
     81echo 8 > /sys/class/gpio/export # export gpio 8 which will get configured as an input
    7082}}}
    7183
    7284=== Set Direction of GPIO ===
    73 {{{
    74 gpioctl dirout x
    75 gpioctl dirin x
     85{{{#!bash
     86echo out > /sys/class/gpio/gpio8/value # make gpio8 an output
     87echo in > /sys/class/gpio/gpio8/value # make gpio8 an input
    7688}}}
    7789
    7890=== Set Output of GPIO ===
    79 {{{
    80 gpioctl clear x
    81 gpioctl set x
     91{{{#!bash
     92echo 0 > /sys/class/gpio/gpio8/value # set gpio8 to logic low
     93echo 1 > /sys/class/gpio/gpio8/value # set gpio8 to logic high
    8294}}}
    8395
    8496=== Check GPIO ===
    85 
    86 {{{
    87 cat /sys/kernel/debug/gpio
     97{{{#!bash
     98cat /sys/kernel/debug/gpio # see all gpio's
     99cat /sys/class/gpio/gpio8/value # see state of gpio8
    88100}}}
    89101
    90 === Set GPIO ===
    91102
    92 {{{
    93 echo 0 > /sys/class/gpio/gpio10/value #set low
    94 echo 255 > /sys/class/gpio/gpio10/value #set high
    95 }}}
     103[=#i2c]
     104== I2C ==
     105See also:
     106 * [wiki:I2C]
     107 * [wiki:linux/i2c]
    96108
    97 == I2C ==
    98109=== Detect all available i2c devices ===
    99 {{{
     110{{{#!bash
    100111i2cdetect -f -y 0
    101112}}}
     
    103114=== Read i2c address ===
    104115Where "x" is the device id, and "y" is the wanted address
    105 {{{
     116{{{#!bash
    106117i2cget -f -y 0 x y
    107118}}}
     
    109120=== Write i2c Address ===
    110121Where "x" is the device id, and "y" is the wanted address to write and "z" is the value to write
    111 {{{
     122{{{#!bash
    112123i2cset -f -y 0 x y z
    113124}}}
    114125
     126
     127[=#kernel]
    115128== Kernel Modules ==
     129See also:
     130 * [wiki:kernel]
     131
    116132=== Find modules loaded by kernel ===
    117 {{{
     133{{{#!bash
    118134lsmod
    119135}}}