OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [libchip/] [serial/] [z85c30_reg.c] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: z85c30_reg.c,v 1.2 2001-09-27 12:01:42 chris Exp $
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
 
30
unsigned8 _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
 
56
void _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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.