source: rtems/c/src/libchip/serial/z85c30_reg.c @ 866c9dd5

4.104.114.84.95
Last change on this file since 866c9dd5 was f246caf, checked in by Joel Sherrill <joel.sherrill@…>, on 07/25/98 at 14:13:34

Interrupts were incorrectly managed with a disable/disable pair rather
than with a disable/enable pair.

  • 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 *  Copyright assigned to U.S. Government, 1994.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.OARcorp.com/rtems/license.html.
14 *
15 *  $Id$
16 */
17
18#include <rtems.h>
19
20#ifndef _Z85C30_MULTIPLIER
21#define _Z85C30_MULTIPLIER 1
22#define _Z85C30_NAME(_X) _X
23#define _Z85C30_TYPE unsigned8
24#endif
25
26/*
27 *  Z85C30 Get Register Routine
28 */
29
30unsigned8 _Z85C30_NAME(z85c30_get_register)(
31  unsigned32  ulCtrlPort,
32  unsigned8   ucRegNum
33)
34{
35  _Z85C30_TYPE          *port;
36  unsigned8              data;
37  rtems_interrupt_level  level;
38
39  port = (_Z85C30_TYPE *)ulCtrlPort;
40
41  rtems_interrupt_disable(level);
42
43    if(ucRegNum) {
44      *port = ucRegNum;
45    }
46    data = *port;
47  rtems_interrupt_enable(level);
48
49  return data;
50}
51
52/*
53 *  Z85C30 Set Register Routine
54 */
55
56void _Z85C30_NAME(z85c30_set_register)(
57  unsigned32  ulCtrlPort,
58  unsigned8   ucRegNum,
59  unsigned8   ucData
60)
61{
62  _Z85C30_TYPE          *port;
63  rtems_interrupt_level  level;
64
65  port = (_Z85C30_TYPE *)ulCtrlPort;
66
67  rtems_interrupt_disable(level);
68    if(ucRegNum) {
69      *port = ucRegNum;
70    }
71    *port = ucData;
72  rtems_interrupt_enable(level);
73}
Note: See TracBrowser for help on using the repository browser.