CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
7.
Front LED Device Interface
The CrossCore XA device has user controllable LED in the front. It can be set to flash at 1-50 Hz, or
to be constantly on or off. Device also has two CAN leds that can be controlled through ioctl()
calls.
7.1.
Configuration of device interface
The front and CAN LED driver is accessed through device node /dev/frontled.
7.2.
Summary of data types
The interface to the front LED device doesn’t need to use an explicit data type, simply use an
unsigned integer. The unsigned integer values are explained in the following table:
Define
Description
CROSS_DIG_IOC_SET_STATUS_LED
Set the state of the front LED. 16-bit unsigned integer.
Upper 8 – bit contains the LED color to control (0 = RED, 1 =
GREEN, 2 = AMBER).
Lower 8 - bit containing the LED flash interval in Hertz (0 = off, 1-
50 = valid Hertz, >50 = constantly on)
CROSS_DIG_IOC_SET_CAN0_LED
Set state of the CAN0 LED. 16-bit unsigned integer.
Upper 8 – bit contains the LED color to control (0 = RED, 1 =
GREEN, 2 = AMBER).
Lower 8 - bit containing the LED flash interval in Hertz (0 = off, 1-
50 = valid Hertz, >50 = constantly on)
CROSS_DIG_IOC_SET_CAN1_LED
Set state of the CAN1 LED. 16-bit unsigned integer.
Upper 8 – bit contains the LED color to control (0 = RED, 1 =
GREEN, 2 = AMBER).
Lower 8 - bit containing the LED flash interval in Hertz (0 = off, 1-
50 = valid Hertz, >50 = constantly on)
7.3.
Interface functions
open
Opens the front LED device
close
Closes the front LED device
write
Writes to the front LED device
ioctl
Writes to the front LED device through a specific function call
www.crosscontrol.com
38