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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [libchip/] [serial/] [z85c30_reg.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  z85c30_reg.c,v 1.4 2001/03/02 18:17:22 joel Exp
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
}

powered by: WebSVN 2.1.0

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