source: rtems/c/src/libchip/serial/mc68681_reg.c @ 94365d9

4.104.114.84.95
Last change on this file since 94365d9 was 94365d9, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:53:19 PM

2003-09-04 Joel Sherrill <joel@…>

  • ide/ata.c, ide/ata.h, ide/ata_internal.h, ide/ide_controller.c, ide/ide_ctrl.h, ide/ide_ctrl_cfg.h, ide/ide_ctrl_io.h, network/cs8900.c, network/cs8900.c.bsp, network/cs8900.h, network/dec21140.c, network/elnk.c, network/open_eth.c, network/sonic.c, network/sonic.h, rtc/icm7170.c, rtc/icm7170.h, rtc/icm7170_reg.c, rtc/icm7170_reg2.c, rtc/icm7170_reg4.c, rtc/icm7170_reg8.c, rtc/m48t08.c, rtc/m48t08.h, rtc/m48t08_reg.c, rtc/m48t08_reg2.c, rtc/m48t08_reg4.c, rtc/m48t08_reg8.c, rtc/rtc.h, rtc/rtcprobe.c, serial/mc68681.c, serial/mc68681.h, serial/mc68681_p.h, serial/mc68681_reg.c, serial/mc68681_reg2.c, serial/mc68681_reg4.c, serial/mc68681_reg8.c, serial/serial.h, serial/z85c30.c, serial/z85c30.h, serial/z85c30_p.h, serial/z85c30_reg.c: URL for license changed.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  This file contains a typical set of register access routines which may be
3 *  used with the mc68681 chip if accesses to the chip are as follows:
4 *
5 *    + registers are accessed as bytes
6 *    + registers are only byte-aligned (no address gaps)
7 *
8 *  COPYRIGHT (c) 1989-1997.
9 *  On-Line Applications Research Corporation (OAR).
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.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#include <rtems.h>
19
20#ifndef _MC68681_MULTIPLIER
21#define _MC68681_MULTIPLIER 1
22#define _MC68681_NAME(_X) _X
23#define _MC68681_TYPE unsigned8
24#endif
25
26#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
27  (_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
28
29/*
30 *  MC68681 Get Register Routine
31 */
32
33unsigned8 _MC68681_NAME(mc68681_get_register)(
34  unsigned32  ulCtrlPort,
35  unsigned8   ucRegNum
36)
37{
38  _MC68681_TYPE *port;
39
40  port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
41
42  return *port;
43}
44
45/*
46 *  MC68681 Set Register Routine
47 */
48
49void  _MC68681_NAME(mc68681_set_register)(
50  unsigned32  ulCtrlPort,
51  unsigned8   ucRegNum,
52  unsigned8   ucData
53)
54{
55  _MC68681_TYPE *port;
56
57  port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
58
59  *port = ucData;
60}
Note: See TracBrowser for help on using the repository browser.