4.104.114.84.95
Last change
on this file since 3299388d was
16a384cf,
checked in by Joel Sherrill <joel.sherrill@…>, on 04/23/99 at 16:35:11
|
New BSP from Tony R. Ambardar <tonya@…> from the
University of British Columbia. The BSP is for:
Yes, this is the "entry model" of a series of boards from Technologic
Systems. Costs <$200 I believe. They have a WWW page at www.t-systems.com.
I am letting them know about the availability of this BSP too.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package body TS1325.LED is |
---|
2 | |
---|
3 | protected body LED_State is |
---|
4 | |
---|
5 | function Get return LED_Colour is |
---|
6 | State: Byte; |
---|
7 | Red_On, Green_On: Boolean; |
---|
8 | begin |
---|
9 | Inport (LED_Port, State); |
---|
10 | |
---|
11 | Green_On := (State and Green_Bit) = Green_Bit; |
---|
12 | Red_On := (State and Red_Bit) /= Red_Bit; |
---|
13 | |
---|
14 | if not (Green_On or Red_On) then |
---|
15 | return Off; |
---|
16 | elsif Green_On and not Red_On then |
---|
17 | return Green; |
---|
18 | elsif Green_On and Red_On then |
---|
19 | return Yellow; |
---|
20 | else |
---|
21 | return Red; |
---|
22 | end if; |
---|
23 | end Get; |
---|
24 | |
---|
25 | procedure Set (Col: in LED_Colour) is |
---|
26 | State: Byte; |
---|
27 | begin |
---|
28 | Inport (LED_Port, State); |
---|
29 | |
---|
30 | case Col is |
---|
31 | when Off => |
---|
32 | State := (State and not Green_Bit) or Red_Bit; |
---|
33 | when Green => |
---|
34 | State := State or Green_Bit or Red_Bit; |
---|
35 | when Yellow => |
---|
36 | State := (State or Green_Bit) and not Red_Bit; |
---|
37 | when Red => |
---|
38 | State := State and not (Green_Bit or Red_Bit); |
---|
39 | end case; |
---|
40 | |
---|
41 | Outport (LED_Port, State); |
---|
42 | end Set; |
---|
43 | |
---|
44 | end LED_State; |
---|
45 | |
---|
46 | end TS1325.LED; |
---|
Note: See
TracBrowser
for help on using the repository browser.