source: rtems/c/src/libchip/serial/z85c30_reg.c @ 642c500

4.104.115
Last change on this file since 642c500 was 642c500, checked in by Joel Sherrill <joel.sherrill@…>, on 04/26/10 at 00:58:39

2010-04-25 Joel Sherrill <joel.sherrilL@…>

  • libchip/serial/mc68681.c, libchip/serial/mc68681_reg.c, libchip/serial/ns16550.c, libchip/serial/serial.h, libchip/serial/z85c30.c, libchip/serial/z85c30_reg.c: Use uintptr_t or intptr_t instead of uint32_t or int32_t.
  • 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.rtems.com/license/LICENSE.
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 uint8_t
23#endif
24
25/*
26 *  Z85C30 Get Register Routine
27 */
28
29uint8_t   _Z85C30_NAME(z85c30_get_register)(
30  uintptr_t   ulCtrlPort,
31  uint8_t     ucRegNum
32)
33{
34  _Z85C30_TYPE          *port;
35  uint8_t                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
55void _Z85C30_NAME(z85c30_set_register)(
56  uintptr_t   ulCtrlPort,
57  uint8_t     ucRegNum,
58  uint8_t     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.