[prev in list] [next in list] [prev in thread] [next in thread] 

List:       voyage-linux
Subject:    Re: [Voyage-linux] re: Alix 3C3 and LEDs
From:       Joel Carter <Joel_Carter () bcit ! ca>
Date:       2008-09-18 21:08:39
Message-ID: OF87C0FCFC.57584C0D-ON882574C8.0073091D-882574C8.00742686 () bcit ! ca
[Download RAW message or body]

[Attachment #2 (multipart/related)]

[Attachment #4 (multipart/alternative)]

[Attachment #6 (text/plain)]

Hi Bart.

I just got my hands on another ALIX3C3 as I hadn't had a chance to try your
suggestion until now. I also have problems compiling your program on Voyage
itself and on Ubuntu. Not sure what packages I need for those C headers,
but I WAS able to compile it on my CentOS 4.5 box. I've attached that for
others. Here's my output from your program:

   iopl succeeded


   before                l_LOCK: [613C]        0
   execute                     : [613C]        0
   after                 l_LOCK: [613C]        0

   before                h_LOCK: [61BC]        0
   execute                     : [61BC]        0
   after                 h_LOCK: [61BC]        0

   before               l_INPUT: [6120]  F7AF085
   execute                     : [6120]   400000
   after                l_INPUT: [6120]  F7AF085

   before                l_AUX1: [6110] 3FFDC002
   execute                     : [6110]   400000
   after                 l_AUX1: [6110] 3FFDC002

   before                l_AUX2: [6114] FFFF0000
   execute                     : [6114]   400000
   after                 l_AUX2: [6114] FFFF0000

   before          l_OPEN_DRAIN: [6108] FFBF0040
   execute                     : [6108]       40
   after           l_OPEN_DRAIN: [6108] FFBF0040

   before              l_OUTPUT: [6104] 3FBDC042
   execute                     : [6104]       40
   after               l_OUTPUT: [6104] 3FBDC042

   before               h_INPUT: [61A0] EBFF1400
   execute                     : [61A0]  A000000
   after                h_INPUT: [61A0] EBFF1400

   before                h_AUX1: [6190] FEFF0100
   execute                     : [6190]  A000000
   after                 h_AUX1: [6190] FEFF0100

   before                h_AUX2: [6194] FFFF0000
   execute                     : [6194]  A000000
   after                 h_AUX2: [6194] FFFF0000

   before          h_OPEN_DRAIN: [6188] F5FF0A00
   execute                     : [6188]      A00
   after           h_OPEN_DRAIN: [6188] F5FF0A00

   before              h_OUTPUT: [6184] F4FF0B00
   execute                     : [6184]      A00
   after               h_OUTPUT: [6184] F4FF0B00
   Disable all leds

   before                l_PINS: [6100] FFBF0040
   execute                     : [6100]       40
   after                 l_PINS: [6100] FFBF0040

   before                h_PINS: [6180] FFFF0000
   execute                     : [6180]      A00
   after                 h_PINS: [6180] F5FF0A00
   Enable led 1

   before                l_PINS: [6100] FFBF0040
   execute                     : [6100]   400000
   after                 l_PINS: [6100] FFFF0000
   Enable led 2

   before                h_PINS: [6180] F5FF0A00
   execute                     : [6180]  2000000
   after                 h_PINS: [6180] F7FF0800
   Enable led 3

   before                h_PINS: [6180] F7FF0800
   execute                     : [6180]  8000000
   after                 h_PINS: [6180] FFFF0000

It sequences through the LED's a couple times and then leaves them all on.
I then try (as suggested in Voyage README):

To turn off LED:
             # echo 0 > /sys/class/leds/alix\:1/brightness

No response. Then:

To turn on LED on ALIX:
             # echo 1 > /sys/class/leds/alix\:1/brightness

The first LED turns OFF (opposite to expected).

So it seems like we're getting close - we can turn them all on and then off
but then your program needs to be run again to turn them on again.

This isn't a major priority for me anymore but just wanted to share my
experiences in case someone else was concerned with getting their LED's
operational.

Thanks again, Joel.
(See attached file: testled)
------------------------------------------------------------------------
Joel Carter
Internet Engineering Lab (IEL)
Group for Advanced Information Technology (GAIT)
British Columbia Institute of Technology
http://www.bcit.ca/appliedresearch
e jcarter@bcit.ca
p 604 451-6929
f 604 436-0286
------------------------------------------------------------------------



                                                                           
             Bart Jooris                                                   
             <Bart.Jooris@inte                                             
             c.ugent.be>                                                To 
                                       Joel Carter <Joel_Carter@bcit.ca>,  
             Aug 13, 2008              Sancho <sancho@sancho.sk>           
             07:07 AM                                                   cc 
                                       voyage-linux@voyage.hk              
                                                                   Subject 
                                       Re: [Voyage-linux] re: Alix 3C3 and 
                                       LEDs                                
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Joel, Sancho,

Maybe you still have the led problem on the ALIX 3C3?
I Checked the CS5536 datasheet and seems that the chip is not rightly
configured to
use the leds-alix without any reconfig.

on my machines after boot (with still old bios (before July 2008))

led1 was not set as output
led2 was configured as input...
led3 was configured to aux1

see the testled output (check if "before" and "after" differ) on your
machine.

After running testled, leds-alix should work.

Cheers,

Bart Jooris
Researcher
IBBT-IBCN research group-Ghent University




Joel Carter wrote:

> Hi Sancho.
>
> I posed this question awhile ago to the list and never got a
> resolution for getting the LED's working on my 3c3. I have to agree
> that it must be something to do with the different BIOS since I also
> have a 3c1 and just tried it as suggested in the Voyage README and it
> worked perfectly:
>
> $modprobe leds-alix
> $echo 1 > /sys/class/leds/alix\:2/brightness
>
> Joel.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Voyage-linux mailing list
>Voyage-linux@list.voyage.hk
>http://list.voyage.hk/mailman/listinfo/voyage-linux
>
>

/*
                               tab:4
* Copyright (c) 2008 Ghent University
* All rights reserved.
 *
 * @author Bart Jooris
 *
 * IBBT - IBCN research group - Ghent University
 * E-mail: Bart.Jooris  intec.UGent.be
 * Implementation testleds alix3c3.
 * After config of GPIO 6, 25 and 27 (see schematics of ALIX3C3)
 * all leds will be disabled
 * then every second a led will be enabled
 *
 * compile with: gcc testled.c -o testled
 **/


#define extern static
#include <asm/io.h>
#undef extern
#include <stdio.h>
#include <sys/ioctl.h>

#define CS5536_BASE 0x06100
#define CLEAR_BIT_6  (unsigned long) 0x00400000
#define SET_BIT_6    (unsigned long) 0x00000040
#define CLEAR_BIT_9  (unsigned long) 0x02000000
#define SET_BIT_9    (unsigned long) 0x00000200
#define CLEAR_BIT_11 (unsigned long) 0x08000000
#define SET_BIT_11   (unsigned long) 0x00000800

void wrapped_outl (char info[], long addr, long value) {
             printf("\n");
             printf("before  %20s: [%X] %8X\n", info, addr, inl_p(addr));
             printf("execute %20s: [%X] %8X\n", "", addr, value);
             outl_p(value,addr);
             printf("after   %20s: [%X] %8X\n", info, addr, inl_p(addr));
}

int main (int argc, char **argv) {
             if (iopl(3)==0) printf("iopl succeeded\n\n");

//-------Begin
config-----------------------------------------------------------

//See Registers of CS5536 @ datasheet p 480-

             //Check LOCK
             wrapped_outl ("l_LOCK",CS5536_BASE+0x03C,0);
             wrapped_outl ("h_LOCK",CS5536_BASE+0x0BC,0);

             //config LED 1 (GPIO 6)
             //Disable INPUT
             wrapped_outl("l_INPUT",CS5536_BASE+0x020,CLEAR_BIT_6);
             //Disable AUX 1
             wrapped_outl("l_AUX1",CS5536_BASE+0x010,CLEAR_BIT_6);
             //Disable AUX 2
             wrapped_outl("l_AUX2",CS5536_BASE+0x014,CLEAR_BIT_6);
             //Enable open drain
             wrapped_outl("l_OPEN_DRAIN",CS5536_BASE+0x008,SET_BIT_6);
             //Enable output
             wrapped_outl("l_OUTPUT",CS5536_BASE+0x004,SET_BIT_6);

             //config LED 2 and 3 (GPIO 25 and 27)
             //Disable INPUT
             wrapped_outl("h_INPUT",CS5536_BASE+0x0A0,CLEAR_BIT_9 |
CLEAR_BIT_11);
             //Disable AUX 1
             wrapped_outl("h_AUX1",CS5536_BASE+0x090,CLEAR_BIT_9 |
CLEAR_BIT_11);
             //Disable AUX 2
             wrapped_outl("h_AUX2",CS5536_BASE+0x094,CLEAR_BIT_9 |
CLEAR_BIT_11);
             //Enable open drain
             wrapped_outl("h_OPEN_DRAIN",CS5536_BASE+0x088,SET_BIT_9 |
SET_BIT_11);
             //Enable output
             wrapped_outl("h_OUTPUT",CS5536_BASE+0x084,SET_BIT_9 |
SET_BIT_11);

//-------End of
config-----------------------------------------------------------

             printf("Disable all leds\n");
             //Disable LED1
             wrapped_outl("l_PINS",CS5536_BASE+0x000, SET_BIT_6);
             //disable LED 2 and 3
             wrapped_outl("h_PINS",CS5536_BASE+0x080, SET_BIT_9 |
SET_BIT_11);

             sleep(1);
             printf("Enable led 1\n");
             //Enable LED1
             wrapped_outl("l_PINS",CS5536_BASE+0x000, CLEAR_BIT_6);

             sleep(1);
             printf("Enable led 2\n");
             //Enable LED2
             wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_9);

             sleep(1);
             printf("Enable led 3\n");
             //Enable LED3
             wrapped_outl("h_PINS",CS5536_BASE+0x080, CLEAR_BIT_11);
}


[Attachment #7 (text/html)]

<html><body>
<p>Hi Bart.<br>
<br>
I just got my hands on another ALIX3C3 as I hadn't had a chance to try your \
suggestion until now. I also have problems compiling your program on Voyage itself \
and on Ubuntu. Not sure what packages I need for those C headers, but I WAS able to \
compile it on my CentOS 4.5 box. I've attached that for others. Here's my output from \
your program:<br>

<ul><font face="Courier New">iopl succeeded</font><br>
<br>
<br>
<font face="Courier New">before                l_LOCK: [613C]        0</font><br>
<font face="Courier New">execute                     : [613C]        0</font><br>
<font face="Courier New">after                 l_LOCK: [613C]        0</font><br>
<br>
<font face="Courier New">before                h_LOCK: [61BC]        0</font><br>
<font face="Courier New">execute                     : [61BC]        0</font><br>
<font face="Courier New">after                 h_LOCK: [61BC]        0</font><br>
<br>
<font face="Courier New">before               l_INPUT: [6120]  F7AF085</font><br>
<font face="Courier New">execute                     : [6120]   400000</font><br>
<font face="Courier New">after                l_INPUT: [6120]  F7AF085</font><br>
<br>
<font face="Courier New">before                l_AUX1: [6110] 3FFDC002</font><br>
<font face="Courier New">execute                     : [6110]   400000</font><br>
<font face="Courier New">after                 l_AUX1: [6110] 3FFDC002</font><br>
<br>
<font face="Courier New">before                l_AUX2: [6114] FFFF0000</font><br>
<font face="Courier New">execute                     : [6114]   400000</font><br>
<font face="Courier New">after                 l_AUX2: [6114] FFFF0000</font><br>
<br>
<font face="Courier New">before          l_OPEN_DRAIN: [6108] FFBF0040</font><br>
<font face="Courier New">execute                     : [6108]       40</font><br>
<font face="Courier New">after           l_OPEN_DRAIN: [6108] FFBF0040</font><br>
<br>
<font face="Courier New">before              l_OUTPUT: [6104] 3FBDC042</font><br>
<font face="Courier New">execute                     : [6104]       40</font><br>
<font face="Courier New">after               l_OUTPUT: [6104] 3FBDC042</font><br>
<br>
<font face="Courier New">before               h_INPUT: [61A0] EBFF1400</font><br>
<font face="Courier New">execute                     : [61A0]  A000000</font><br>
<font face="Courier New">after                h_INPUT: [61A0] EBFF1400</font><br>
<br>
<font face="Courier New">before                h_AUX1: [6190] FEFF0100</font><br>
<font face="Courier New">execute                     : [6190]  A000000</font><br>
<font face="Courier New">after                 h_AUX1: [6190] FEFF0100</font><br>
<br>
<font face="Courier New">before                h_AUX2: [6194] FFFF0000</font><br>
<font face="Courier New">execute                     : [6194]  A000000</font><br>
<font face="Courier New">after                 h_AUX2: [6194] FFFF0000</font><br>
<br>
<font face="Courier New">before          h_OPEN_DRAIN: [6188] F5FF0A00</font><br>
<font face="Courier New">execute                     : [6188]      A00</font><br>
<font face="Courier New">after           h_OPEN_DRAIN: [6188] F5FF0A00</font><br>
<br>
<font face="Courier New">before              h_OUTPUT: [6184] F4FF0B00</font><br>
<font face="Courier New">execute                     : [6184]      A00</font><br>
<font face="Courier New">after               h_OUTPUT: [6184] F4FF0B00</font><br>
<font face="Courier New">Disable all leds</font><br>
<br>
<font face="Courier New">before                l_PINS: [6100] FFBF0040</font><br>
<font face="Courier New">execute                     : [6100]       40</font><br>
<font face="Courier New">after                 l_PINS: [6100] FFBF0040</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] FFFF0000</font><br>
<font face="Courier New">execute                     : [6180]      A00</font><br>
<font face="Courier New">after                 h_PINS: [6180] F5FF0A00</font><br>
<font face="Courier New">Enable led 1</font><br>
<br>
<font face="Courier New">before                l_PINS: [6100] FFBF0040</font><br>
<font face="Courier New">execute                     : [6100]   400000</font><br>
<font face="Courier New">after                 l_PINS: [6100] FFFF0000</font><br>
<font face="Courier New">Enable led 2</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] F5FF0A00</font><br>
<font face="Courier New">execute                     : [6180]  2000000</font><br>
<font face="Courier New">after                 h_PINS: [6180] F7FF0800</font><br>
<font face="Courier New">Enable led 3</font><br>
<br>
<font face="Courier New">before                h_PINS: [6180] F7FF0800</font><br>
<font face="Courier New">execute                     : [6180]  8000000</font><br>
<font face="Courier New">after                 h_PINS: [6180] FFFF0000</font></ul>
<br>
It sequences through the LED's a couple times and then leaves them all on. I then try \
(as suggested in Voyage README):<br> <br>
<font face="Courier New">To turn off LED:<br>
		 # echo 0 &gt; /sys/class/leds/alix\:1/brightness</font><font size="4" \
face="DANNY"><br> </font><tt><font size="4"><br>
</font></tt>No response. Then:<br>
<br>
<font face="Courier New">To turn on LED on ALIX:<br>
		 # echo 1 &gt; /sys/class/leds/alix\:1/brightness</font><tt><font size="4"><br>
</font></tt><br>
The first LED turns OFF (opposite to expected).<br>
<br>
So it seems like we're getting close - we can turn them all on and then off but then \
your program needs to be run again to turn them on again. <br> <br>
This isn't a major priority for me anymore but just wanted to share my experiences in \
case someone else was concerned with getting their LED's operational.<br> <br>
Thanks again, Joel.<br>
<i>(See attached file: testled)</i><br>
------------------------------------------------------------------------<br>
Joel Carter<br>
Internet Engineering Lab (IEL)<br>
Group for Advanced Information Technology (GAIT)<br>
British Columbia Institute of Technology<br>
<a href="http://www.bcit.ca/appliedresearch">http://www.bcit.ca/appliedresearch</a><br>
 e jcarter@bcit.ca<br>
p 604 451-6929<br>
f 604 436-0286<br>
------------------------------------------------------------------------<br>
<br>
<img width="16" height="16" src="cid:2__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" \
border="0" alt="Inactive hide details for Bart Jooris \
&lt;Bart.Jooris@intec.ugent.be&gt;">Bart Jooris \
&lt;Bart.Jooris@intec.ugent.be&gt;<br> <br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td \
style="background-image:url(cid:3__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca); \
background-repeat: no-repeat; " width="40%"> <ul>
<ul>
<ul>
<ul><b><font size="2">Bart Jooris &lt;Bart.Jooris@intec.ugent.be&gt;</font></b><font \
size="2"> </font> <p><font size="2">Aug 13, 2008 07:07 AM</font></ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" \
src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br> <div \
align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" \
height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" \
alt=""><br> <font size="2">Joel Carter &lt;Joel_Carter@bcit.ca&gt;, Sancho \
&lt;sancho@sancho.sk&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" \
src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br> <div \
align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" \
height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" \
alt=""><br> <font size="2">voyage-linux@voyage.hk</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" \
src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""><br> <div \
align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" \
height="1" src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" \
alt=""><br> <font size="2">Re: [Voyage-linux] re: Alix 3C3 and LEDs</font></td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" \
src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""></td><td \
width="336"><img width="1" height="1" \
src="cid:4__=07BBFE5BDFE08F8D8f9e8a93df938690@bcit.ca" border="0" alt=""></td></tr> \
</table> </td></tr>
</table>
<br>
<tt>Hi Joel, Sancho,<br>
<br>
Maybe you still have the led problem on the ALIX 3C3?<br>
I Checked the CS5536 datasheet and seems that the chip is not rightly <br>
configured to<br>
use the leds-alix without any reconfig.<br>
<br>
on my machines after boot (with still old bios (before July 2008))<br>
<br>
led1 was not set as output<br>
led2 was configured as input...<br>
led3 was configured to aux1<br>
<br>
see the testled output (check if &quot;before&quot; and &quot;after&quot; differ) on \
your <br> machine.<br>
<br>
After running testled, leds-alix should work.<br>
<br>
Cheers,<br>
<br>
Bart Jooris<br>
Researcher<br>
IBBT-IBCN research group-Ghent University<br>
<br>
<br>
<br>
<br>
Joel Carter wrote:<br>
<br>
&gt; Hi Sancho.<br>
&gt;<br>
&gt; I posed this question awhile ago to the list and never got a <br>
&gt; resolution for getting the LED's working on my 3c3. I have to agree <br>
&gt; that it must be something to do with the different BIOS since I also <br>
&gt; have a 3c1 and just tried it as suggested in the Voyage README and it <br>
&gt; worked perfectly:<br>
&gt;<br>
&gt; $modprobe leds-alix<br>
&gt; $echo 1 &gt; /sys/class/leds/alix\:2/brightness<br>
&gt;<br>
&gt; Joel.<br>
&gt;<br>
&gt;------------------------------------------------------------------------<br>
&gt;<br>
&gt;_______________________________________________<br>
&gt;Voyage-linux mailing list<br>
&gt;Voyage-linux@list.voyage.hk<br>
&gt;<a href="http://list.voyage.hk/mailman/listinfo/voyage-linux">http://list.voyage.hk/mailman/listinfo/voyage-linux</a><br>
 &gt; &nbsp;<br>
&gt;<br>
<br>
/*		 		 		 		 		 		 		 		 		 tab:4<br>
* Copyright (c) 2008 Ghent University &nbsp; &nbsp;<br>
* All rights reserved.<br>
 *<br>
 * @author Bart Jooris<br>
 * <br>
 * IBBT - IBCN research group - Ghent University<br>
 * E-mail: Bart.Jooris &nbsp;intec.UGent.be<br>
 * Implementation testleds alix3c3.<br>
 * After config of GPIO 6, 25 and 27 (see schematics of ALIX3C3)<br>
 * all leds will be disabled<br>
 * then every second a led will be enabled<br>
 * <br>
 * compile with: gcc testled.c -o testled &nbsp; &nbsp; &nbsp;<br>
 **/<br>
<br>
<br>
#define extern static<br>
#include &lt;asm/io.h&gt;<br>
#undef extern<br>
#include &lt;stdio.h&gt;<br>
#include &lt;sys/ioctl.h&gt;<br>
<br>
#define CS5536_BASE 0x06100<br>
#define CLEAR_BIT_6 &nbsp;(unsigned long) 0x00400000<br>
#define SET_BIT_6 &nbsp; &nbsp;(unsigned long) 0x00000040<br>
#define CLEAR_BIT_9 &nbsp;(unsigned long) 0x02000000<br>
#define SET_BIT_9 &nbsp; &nbsp;(unsigned long) 0x00000200<br>
#define CLEAR_BIT_11 (unsigned long) 0x08000000<br>
#define SET_BIT_11 &nbsp; (unsigned long) 0x00000800<br>
<br>
void wrapped_outl (char info[], long addr, long value) {<br>
		 printf(&quot;\n&quot;);<br>
		 printf(&quot;before &nbsp;%20s: [%X] %8X\n&quot;, info, addr, inl_p(addr));<br>
		 printf(&quot;execute %20s: [%X] %8X\n&quot;, &quot;&quot;, addr, value);<br>
		 outl_p(value,addr);<br>
		 printf(&quot;after &nbsp; %20s: [%X] %8X\n&quot;, info, addr, inl_p(addr));<br>
}<br>
<br>
int main (int argc, char **argv) {<br>
		 if (iopl(3)==0) printf(&quot;iopl succeeded\n\n&quot;);<br>
<br>
//-------Begin config-----------------------------------------------------------<br>
<br>
//See Registers of CS5536 @ datasheet p 480- <br>
<br>
		 //Check LOCK<br>
		 wrapped_outl (&quot;l_LOCK&quot;,CS5536_BASE+0x03C,0);<br>
		 wrapped_outl (&quot;h_LOCK&quot;,CS5536_BASE+0x0BC,0);<br>
<br>
		 //config LED 1 (GPIO 6)<br>
		 //Disable INPUT<br>
		 wrapped_outl(&quot;l_INPUT&quot;,CS5536_BASE+0x020,CLEAR_BIT_6);<br>
		 //Disable AUX 1<br>
		 wrapped_outl(&quot;l_AUX1&quot;,CS5536_BASE+0x010,CLEAR_BIT_6);<br>
		 //Disable AUX 2<br>
		 wrapped_outl(&quot;l_AUX2&quot;,CS5536_BASE+0x014,CLEAR_BIT_6);<br>
		 //Enable open drain<br>
		 wrapped_outl(&quot;l_OPEN_DRAIN&quot;,CS5536_BASE+0x008,SET_BIT_6);<br>
		 //Enable output<br>
		 wrapped_outl(&quot;l_OUTPUT&quot;,CS5536_BASE+0x004,SET_BIT_6);<br>
<br>
		 //config LED 2 and 3 (GPIO 25 and 27)<br>
		 //Disable INPUT<br>
		 wrapped_outl(&quot;h_INPUT&quot;,CS5536_BASE+0x0A0,CLEAR_BIT_9 | \
CLEAR_BIT_11);<br>  //Disable AUX 1<br>
		 wrapped_outl(&quot;h_AUX1&quot;,CS5536_BASE+0x090,CLEAR_BIT_9 | CLEAR_BIT_11);<br>
		 //Disable AUX 2<br>
		 wrapped_outl(&quot;h_AUX2&quot;,CS5536_BASE+0x094,CLEAR_BIT_9 | CLEAR_BIT_11);<br>
		 //Enable open drain<br>
		 wrapped_outl(&quot;h_OPEN_DRAIN&quot;,CS5536_BASE+0x088,SET_BIT_9 | \
SET_BIT_11);<br>  //Enable output<br>
		 wrapped_outl(&quot;h_OUTPUT&quot;,CS5536_BASE+0x084,SET_BIT_9 | SET_BIT_11);<br>
<br>
//-------End of config-----------------------------------------------------------<br>
<br>
		 printf(&quot;Disable all leds\n&quot;);<br>
		 //Disable LED1<br>
		 wrapped_outl(&quot;l_PINS&quot;,CS5536_BASE+0x000, SET_BIT_6);<br>
		 //disable LED 2 and 3<br>
		 wrapped_outl(&quot;h_PINS&quot;,CS5536_BASE+0x080, SET_BIT_9 | SET_BIT_11);<br>
<br>
		 sleep(1);<br>
		 printf(&quot;Enable led 1\n&quot;);<br>
		 //Enable LED1<br>
		 wrapped_outl(&quot;l_PINS&quot;,CS5536_BASE+0x000, CLEAR_BIT_6);<br>
<br>
		 sleep(1);<br>
		 printf(&quot;Enable led 2\n&quot;);<br>
		 //Enable LED2<br>
		 wrapped_outl(&quot;h_PINS&quot;,CS5536_BASE+0x080, CLEAR_BIT_9);<br>
<br>
		 sleep(1);<br>
		 printf(&quot;Enable led 3\n&quot;);<br>
		 //Enable LED3<br>
		 wrapped_outl(&quot;h_PINS&quot;,CS5536_BASE+0x080, CLEAR_BIT_11);<br>
}<br>
<br>
</tt><br>
</body></html>


["graycol.gif" (image/gif)]
["pic13052.gif" (image/gif)]
["ecblank.gif" (image/gif)]
["=?US-ASCII?B?dGVzdGxlZA==?=" (application/octet-stream)]

_______________________________________________
Voyage-linux mailing list
Voyage-linux@list.voyage.hk
http://list.voyage.hk/mailman/listinfo/voyage-linux


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic