Documentation:NGW/NGW100 LEDs

From AVRFreaks Wiki

Jump to: navigation, search

NGW100 is equipped with four LEDs:

  • Power, lit when power is stable and NGW100 operational.
  • System, lit when Linux is done loading.
  • A and B, user configurable.

The A and B LEDs available to the user can be controlled through Linux' GPIO interface: /dev/gpioN (with N: 0,1,2..)

On the NGWW100, the anode of the LEDs A and B is connected with a series resistance of 220 ohms to Vcc (3,3 volt) and the cathode is connected to the GPIO pin. So if you set the pin to '0', the led is switched on, and if you set it to '1' the led is switched off.

Example:

~ # echo -ne "\x00\x00\x00\x00" >/dev/gpio1
~ #

Will turn on led A because we write a '0' to bit position 19 on second defined gpio function which is /config/gpio/leda and /config/gpio/leda/gpio_id is 0 (port A).

The gpio functions are configured in /etc/init.d/S99gpio

To turn LEDA off the following command will work

~ # echo -ne "\x00\x08\x00\x00" >/dev/gpio1

Here, we write a '1' to bit position 19.


This also works for LEDB

On:

~ # echo -ne "\x00\x00\x00\x00" >/dev/gpio2

Off:

~ # echo -ne "\x00\x08\x00\x00" >/dev/gpio2


Make LED A flash:

cat /dev/urandom > /dev/gpio1

Make LED B flash:

cat /dev/urandom > /dev/gpio2
Personal tools