4.104.114.84.95
Last change
on this file since d0d73ec was
f010a5e,
checked in by Joel Sherrill <joel.sherrill@…>, on 03/02/01 at 18:17:22
|
2001-03-01 Joel Sherrill <joel@…>
- network/cs8900.c, network/cs8900.h, network/sonic.c, network/sonic.h,
rtc/icm7170_reg.c, rtc/icm7170_reg2.c, rtc/icm7170_reg4.c,
rtc/icm7170_reg8.c, rtc/m48t08_reg.c, rtc/m48t08_reg2.c,
rtc/m48t08_reg4.c, rtc/m48t08_reg8.c, serial/mc68681_reg.c,
serial/mc68681_reg2.c, serial/mc68681_reg4.c, serial/mc68681_reg8.c,
serial/z85c30.c, serial/z85c30.h, serial/z85c30_p.h,
serial/z85c30_reg.c: Corrected header.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * This file contains a typical set of register access routines which may be |
---|
3 | * used with the z85c30 chip if accesses to the chip are as follows: |
---|
4 | * |
---|
5 | * + registers are accessed as bytes |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989-1997. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #include <rtems.h> |
---|
18 | |
---|
19 | #ifndef _Z85C30_MULTIPLIER |
---|
20 | #define _Z85C30_MULTIPLIER 1 |
---|
21 | #define _Z85C30_NAME(_X) _X |
---|
22 | #define _Z85C30_TYPE unsigned8 |
---|
23 | #endif |
---|
24 | |
---|
25 | /* |
---|
26 | * Z85C30 Get Register Routine |
---|
27 | */ |
---|
28 | |
---|
29 | unsigned8 _Z85C30_NAME(z85c30_get_register)( |
---|
30 | unsigned32 ulCtrlPort, |
---|
31 | unsigned8 ucRegNum |
---|
32 | ) |
---|
33 | { |
---|
34 | _Z85C30_TYPE *port; |
---|
35 | unsigned8 data; |
---|
36 | rtems_interrupt_level level; |
---|
37 | |
---|
38 | port = (_Z85C30_TYPE *)ulCtrlPort; |
---|
39 | |
---|
40 | rtems_interrupt_disable(level); |
---|
41 | |
---|
42 | if(ucRegNum) { |
---|
43 | *port = ucRegNum; |
---|
44 | } |
---|
45 | data = *port; |
---|
46 | rtems_interrupt_enable(level); |
---|
47 | |
---|
48 | return data; |
---|
49 | } |
---|
50 | |
---|
51 | /* |
---|
52 | * Z85C30 Set Register Routine |
---|
53 | */ |
---|
54 | |
---|
55 | void _Z85C30_NAME(z85c30_set_register)( |
---|
56 | unsigned32 ulCtrlPort, |
---|
57 | unsigned8 ucRegNum, |
---|
58 | unsigned8 ucData |
---|
59 | ) |
---|
60 | { |
---|
61 | _Z85C30_TYPE *port; |
---|
62 | rtems_interrupt_level level; |
---|
63 | |
---|
64 | port = (_Z85C30_TYPE *)ulCtrlPort; |
---|
65 | |
---|
66 | rtems_interrupt_disable(level); |
---|
67 | if(ucRegNum) { |
---|
68 | *port = ucRegNum; |
---|
69 | } |
---|
70 | *port = ucData; |
---|
71 | rtems_interrupt_enable(level); |
---|
72 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.