Re: FW: LED driver
flat view
From: Hans Schillstrom <hidden>
Date: 2005-03-17 10:17:41
Hi,
I have made a driver for our mpc8270 board
It is based upon Denx led_driver and made for 2.6 kernel
(See atached file)
To control the leds you have to perfom some ioctl's
first create your devices
mknod led0 c 151 0 ...
Example howto use it:
void led_off( int file )
{
if (ioctl(file,STATUSLED_SET,0) < 0)
perror("led off: ");
}
void led_blink( int file )
{
if (ioctl(file,STATUSLED_SET,1) < 0)
perror("led blink: ");
}
void led_on( int file )
{
if (ioctl(file,STATUSLED_SET,2) < 0)
perror("led on: ");
}
void led_per( int file, int period )
{
if (ioctl(file,STATUSLED_PERIOD,period) < 0)
perror("led on: ");
}
...
int led0 = open("/dev/led0",O_RDWR)
...
led_blink(led0); /* turn on green LED */
..
/Hans
On Thu, 2005-03-17 at 06:15, srinivas.surabhi@wipro.com wrote:-----Original Message----- From: Srinivas Surabhi (WT01 - TELECOM SOLUTIONS) Sent: Thursday, March 17, 2005 7:53 AM To: <redacted> Subject: LED driver Hi, I am working on the MPC8270 board having connected GPIO 3 lines connected to 3 LEDs. So can any one help me in finding out the best solution of controlling the LEDs from MVlinux (kernel and user space) or any pointers who has done it before. Thanks & Rgds SS Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately and destroy all copies of this message and any attachments. _______________________________________________ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Attachments
- rcb8270_led.c [text/x-c] 17175 bytes · preview