source: rtems/c/src/libchip/serial/mc68681_reg.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.2 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
16#include <rtems.h>
17
18#ifndef _MC68681_MULTIPLIER
19#define _MC68681_MULTIPLIER 1
20#define _MC68681_NAME(_X) _X
21#define _MC68681_TYPE uint8_t
22#endif
23
24#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
25  (_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
26
27/*
28 *  MC68681 Get Register Routine
29 */
30
31uint8_t   _MC68681_NAME(mc68681_get_register)(
32  uintptr_t   ulCtrlPort,
33  uint8_t     ucRegNum
34)
35{
36  _MC68681_TYPE *port;
37
38  port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
39
40  return *port;
41}
42
43/*
44 *  MC68681 Set Register Routine
45 */
46
47void  _MC68681_NAME(mc68681_set_register)(
48  uintptr_t   ulCtrlPort,
49  uint8_t     ucRegNum,
50  uint8_t     ucData
51)
52{
53  _MC68681_TYPE *port;
54
55  port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
56
57  *port = ucData;
58}
Note: See TracBrowser for help on using the repository browser.