source: rtems/c/src/lib/libcpu/mips/mongoosev/duart/mg5uart_reg.c @ 948a069

Last change on this file since 948a069 was acdb6558, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 14, 2001 at 12:49:17 AM

2001-03-13 Joel Sherrill <joel@…>

  • Added mongoose-v, mongoose-v/include, and mongoose-v/vectorisrs directories.
  • mongoosev/.cvsignore, mongoosev/Makefile.am, mongoosev/README, mongoosev/duart/.cvsignore, mongoosev/duart/Makefile.am, mongoosev/duart/README.mguart, mongoosev/duart/mg5uart.c, mongoosev/duart/mg5uart.h, mongoosev/duart/mg5uart_reg.c, mongoosev/include/.cvsignore, mongoosev/include/Makefile.am, mongoosev/include/mongoose-v.h, mongoosev/vectorisrs/.cvsignore, mongoosev/vectorisrs/Makefile.am, mongoosev/vectorisrs/vectorisrs.c: New files.
  • Makefile.am, configure.in, shared/interrupts/Makefile.am, shared/interrupts/maxvectors.c: Added support for mongoosev.
  • tx39/vectorisrs/vectorisrs.c: Corrected warning.
  • 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 mg5uart chip if accesses to the chip are as follows:
4 *
5 *    + registers are accessed as unsigned32's
6 *    + registers are only u32-aligned (no address gaps)
7 *
8 *  COPYRIGHT (c) 1989-2001.
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.OARcorp.com/rtems/license.html.
14 *
15 *  $Id$
16 */
17
18#include <rtems.h>
19
20#ifndef _MG5UART_MULTIPLIER
21#define _MG5UART_MULTIPLIER 1
22#define _MG5UART_NAME(_X) _X
23#define _MG5UART_TYPE unsigned32
24#endif
25
26#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
27  (_MG5UART_TYPE *)((_base) + ((_reg) * _MG5UART_MULTIPLIER ))
28
29/*
30 *  MG5UART Get Register Routine
31 */
32
33unsigned8 _MG5UART_NAME(mg5uart_get_register)(
34  unsigned32  ulCtrlPort,
35  unsigned8   ucRegNum
36)
37{
38  _MG5UART_TYPE *port;
39
40  port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
41
42  return *port;
43}
44
45/*
46 *  MG5UART Set Register Routine
47 */
48
49void  _MG5UART_NAME(mg5uart_set_register)(
50  unsigned32  ulCtrlPort,
51  unsigned8   ucRegNum,
52  unsigned8   ucData
53)
54{
55  _MG5UART_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.