Previous

Next

Bottom

Contents

Glossary

Index

 

Persistor CF1 User's Manual

LED Signal Functions

July 1998

Revision 1.01

 Persistor Instruments Inc.
© 1998 All rights reserved.

Quick Reference Table

LEDGetState

LEDSetState

LEDInit

LEDToggleRG

LEDOrbit

LEDToggleRGOff

Background

There are 2 dual Light Emitting Diodes mounted on your CF1 they can be used by your programs as status indicators or debugging tools if you so desire. This group of functions defines a BIOS level interface to control the status and behavior of these LEDs. Each of the two LED's can be set to be off, red or green.

LEDGetState -- Return the current LED state

Returns the state of the requested LED.

Prototype:

ushort LEDGetState(ushort lrLED);

Definition:

#include <cf1bios.h>

Inputs:

lrLED indicates which LED to get the state for. Use the enumerated values LEDleft and LEDright.

Returns:

Returns the current state of the requested LED.

Notes:

The state of an LED can also be determined using a group of enumerated variables: LEDoff, LEDred, LEDgreen, and LEDbus. The first three should be self explanatory, but the last is an interesting aside. The LEDs are controlled by pins on the 68338 that are available as pins that supply bus status information. A state of LEDbus should make the LED's flicker around a lot. It's not tremendously useful, but somewhat neat.

Timing:

Timing-TBD

LEDInit -- Setup the LED drivers (turns both off)

This function is called at startup and set's up the hardware drivers for the on board LEDs. (Light Emitting Diodes) A users application would not need to call this function. This function also has the default effect of turning of all of the LEDs.

Prototype:

void LEDInit(void);

Definition:

#include <cf1bios.h>

Notes:

Timing:

Timing-TBD

LEDOrbit -- Orbit the LEDs on each call

LEDOrbit allows you to create a circling effect with the two dual LED's on the CF1. Each LED is actually two stacked LEDs with a red one on the bottom and a green one on the top. LEDOrbit when called repeatedly with a delay in between each call makes the LEDs flash in a circle. In other words each call to LEDOrbit turns off the currently active diode and turns on the next one in the "circle."

Prototype:

void LEDOrbit(bool ccw);

Definition:

#include <cf1bios.h>

Inputs:

ccw is a boolean that is TRUE if the LEDs should orbit in the counterclockwise direction.

Notes:

Timing:

Timing-TBD

LEDSetState -- Set the LED state

Set the state of either LED explicitly.

Prototype:

void LEDSetState(ushort lrLED, ushort state);

Definition:

#include <cf1bios.h>

Inputs:

lrLED is either LEDleft or LEDright (enumerated as 0 and 1 respectively)
state is one of these four enumerated values:
LEDoff, LEDred, LEDgreen, and LEDbus

Notes:

The state of an LED can also be determined using a group of enumerated variables: LEDoff, LEDred, LEDgreen, and LEDbus. The first three should be self explanatory, but the last is an interesting aside. The LEDs are controlled by pins on the 68338 that are available as pins that supply bus status information. A state of LEDbus should make the LED's flicker around a lot. It's not tremendously useful, but somewhat neat.

Timing:

Timing-TBD

LEDToggleRG -- Toggle LED between Red and Green

This function toggles the color of the specified LED from red to green or vice versa. If the LED is off when LEDToggleRG is called it will turn on to with a color of red.

Prototype:

void LEDToggleRG(ushort lrLED);

Definition:

#include <cf1bios.h>

Inputs:

lrLED is either LEDleft or LEDright (enumerated as 0 and 1 respectively) and specifies which LED to toggle

Notes:

Timing:

Timing-TBD

LEDToggleRGOff -- Toggle LED between Red, Green, and Off

This function toggles the color of the specified LED from red to green to off in a cyclic manner. If the LED is off when LEDToggleRGOff is called it will turn on to with a color of red.

Prototype:

void LEDToggleRGOff(ushort lrLED);

Definition:

#include <cf1bios.h>

Inputs:

lrLED is either LEDleft or LEDright (enumerated as 0 and 1 respectively) and specifies which LED to toggle

Notes:

Timing:

Timing-TBD

 

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved