forked from Imagelibrary/rtems
New files.
This commit is contained in:
52
c/src/lib/libchip/rtc/README.icm7170
Normal file
52
c/src/lib/libchip/rtc/README.icm7170
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Configuration Table Use
|
||||||
|
=======================
|
||||||
|
|
||||||
|
sDeviceName
|
||||||
|
|
||||||
|
The name of this device.
|
||||||
|
|
||||||
|
deviceType
|
||||||
|
|
||||||
|
This field must be RTC_ICM7170.
|
||||||
|
|
||||||
|
pDeviceFns
|
||||||
|
|
||||||
|
The device interface control table. This must be icm7170_fns.
|
||||||
|
|
||||||
|
deviceProbe
|
||||||
|
|
||||||
|
This is the address of the routine which probes to see if the device
|
||||||
|
is present.
|
||||||
|
|
||||||
|
pDeviceParams
|
||||||
|
|
||||||
|
This field specifies the clock frequency. It may be one of the
|
||||||
|
following:
|
||||||
|
ICM7170_AT_32_KHZ
|
||||||
|
ICM7170_AT_1_MHZ
|
||||||
|
ICM7170_AT_2_MHZ
|
||||||
|
ICM7170_AT_4_MHZ
|
||||||
|
|
||||||
|
ulCtrlPort1
|
||||||
|
|
||||||
|
This field is the base address of the RTC area of the chip.
|
||||||
|
|
||||||
|
ulCtrlPort2
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
ulDataPort
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
|
||||||
|
getRegister
|
||||||
|
setRegister
|
||||||
|
|
||||||
|
These follow standard conventions.
|
||||||
|
|
||||||
48
c/src/lib/libchip/rtc/README.m48t08
Normal file
48
c/src/lib/libchip/rtc/README.m48t08
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Configuration Table Use
|
||||||
|
=======================
|
||||||
|
|
||||||
|
sDeviceName
|
||||||
|
|
||||||
|
The name of this device.
|
||||||
|
|
||||||
|
deviceType
|
||||||
|
|
||||||
|
This field must be RTC_M48T08.
|
||||||
|
|
||||||
|
pDeviceFns
|
||||||
|
|
||||||
|
The device interface control table. This must be m48t08_fns.
|
||||||
|
|
||||||
|
deviceProbe
|
||||||
|
|
||||||
|
This is the address of the routine which probes to see if the device
|
||||||
|
is present.
|
||||||
|
|
||||||
|
pDeviceParams
|
||||||
|
|
||||||
|
This is ignored and should be NULL.
|
||||||
|
|
||||||
|
ulCtrlPort1
|
||||||
|
|
||||||
|
This field is the base address of the RTC area of the chip. The
|
||||||
|
NVRAM portion of the chip is ignored.
|
||||||
|
|
||||||
|
ulCtrlPort2
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
ulDataPort
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
|
||||||
|
getRegister
|
||||||
|
setRegister
|
||||||
|
|
||||||
|
These follow standard conventions.
|
||||||
|
|
||||||
37
c/src/lib/libchip/rtc/STATUS
Normal file
37
c/src/lib/libchip/rtc/STATUS
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
General
|
||||||
|
=======
|
||||||
|
|
||||||
|
+ It would be nice to utilize the interrupt capabilities of some
|
||||||
|
RTC parts. This could be used to trigger checking the software
|
||||||
|
clock against the hardware clock.
|
||||||
|
|
||||||
|
+ The periodic capability of most RTCs is not suitable for use
|
||||||
|
as a general purpose flexible clock tick source. For example,
|
||||||
|
many RTCs generate only a handful of periods with 100 Hz being the
|
||||||
|
most frequent.
|
||||||
|
|
||||||
|
+ The tick field is not set on get. Anything smaller than a second
|
||||||
|
is ignored on set and get operations.
|
||||||
|
|
||||||
|
+ Day of week is ignored since RTEMS does not set it internally.
|
||||||
|
|
||||||
|
+ There is no attempt in RTEMS to know about time zones.
|
||||||
|
|
||||||
|
Harris ICM7170
|
||||||
|
==============
|
||||||
|
|
||||||
|
+ Untested.
|
||||||
|
|
||||||
|
+ Interrupt capabilities are ignored.
|
||||||
|
|
||||||
|
Mostek 48T08
|
||||||
|
============
|
||||||
|
|
||||||
|
+ Untested.
|
||||||
|
|
||||||
|
+ NVRAM is ignored.
|
||||||
|
|
||||||
61
c/src/lib/libchip/rtc/icm7170_reg.c
Normal file
61
c/src/lib/libchip/rtc/icm7170_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _ICM7170_MULTIPLIER
|
||||||
|
#define _ICM7170_MULTIPLIER 1
|
||||||
|
#define _ICM7170_NAME(_X) _X
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_ICM7170_TYPE *)((_base) + ((_reg) * _ICM7170_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICM7170 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _ICM7170_NAME(icm7170_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_ICM7170_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICM7170 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _ICM7170_NAME(icm7170_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_ICM7170_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
24
c/src/lib/libchip/rtc/icm7170_reg2.c
Normal file
24
c/src/lib/libchip/rtc/icm7170_reg2.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 2
|
||||||
|
#define _ICM7170_NAME(_X) _X##_2
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
24
c/src/lib/libchip/rtc/icm7170_reg4.c
Normal file
24
c/src/lib/libchip/rtc/icm7170_reg4.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 4
|
||||||
|
#define _ICM7170_NAME(_X) _X##_4
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
24
c/src/lib/libchip/rtc/icm7170_reg8.c
Normal file
24
c/src/lib/libchip/rtc/icm7170_reg8.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 8
|
||||||
|
#define _ICM7170_NAME(_X) _X##_8
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
61
c/src/lib/libchip/rtc/m48t08_reg.c
Normal file
61
c/src/lib/libchip/rtc/m48t08_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _M48T08_MULTIPLIER
|
||||||
|
#define _M48T08_MULTIPLIER 1
|
||||||
|
#define _M48T08_NAME(_X) _X
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_M48T08_TYPE *)((_base) + ((_reg) * _M48T08_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* M48T08 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _M48T08_NAME(m48t08_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_M48T08_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* M48T08 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _M48T08_NAME(m48t08_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_M48T08_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
24
c/src/lib/libchip/rtc/m48t08_reg2.c
Normal file
24
c/src/lib/libchip/rtc/m48t08_reg2.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 2
|
||||||
|
#define _M48T08_NAME(_X) _X##_2
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
24
c/src/lib/libchip/rtc/m48t08_reg4.c
Normal file
24
c/src/lib/libchip/rtc/m48t08_reg4.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 4
|
||||||
|
#define _M48T08_NAME(_X) _X##_4
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
24
c/src/lib/libchip/rtc/m48t08_reg8.c
Normal file
24
c/src/lib/libchip/rtc/m48t08_reg8.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 8
|
||||||
|
#define _M48T08_NAME(_X) _X##_8
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
52
c/src/libchip/rtc/README.icm7170
Normal file
52
c/src/libchip/rtc/README.icm7170
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Configuration Table Use
|
||||||
|
=======================
|
||||||
|
|
||||||
|
sDeviceName
|
||||||
|
|
||||||
|
The name of this device.
|
||||||
|
|
||||||
|
deviceType
|
||||||
|
|
||||||
|
This field must be RTC_ICM7170.
|
||||||
|
|
||||||
|
pDeviceFns
|
||||||
|
|
||||||
|
The device interface control table. This must be icm7170_fns.
|
||||||
|
|
||||||
|
deviceProbe
|
||||||
|
|
||||||
|
This is the address of the routine which probes to see if the device
|
||||||
|
is present.
|
||||||
|
|
||||||
|
pDeviceParams
|
||||||
|
|
||||||
|
This field specifies the clock frequency. It may be one of the
|
||||||
|
following:
|
||||||
|
ICM7170_AT_32_KHZ
|
||||||
|
ICM7170_AT_1_MHZ
|
||||||
|
ICM7170_AT_2_MHZ
|
||||||
|
ICM7170_AT_4_MHZ
|
||||||
|
|
||||||
|
ulCtrlPort1
|
||||||
|
|
||||||
|
This field is the base address of the RTC area of the chip.
|
||||||
|
|
||||||
|
ulCtrlPort2
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
ulDataPort
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
|
||||||
|
getRegister
|
||||||
|
setRegister
|
||||||
|
|
||||||
|
These follow standard conventions.
|
||||||
|
|
||||||
48
c/src/libchip/rtc/README.m48t08
Normal file
48
c/src/libchip/rtc/README.m48t08
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
Configuration Table Use
|
||||||
|
=======================
|
||||||
|
|
||||||
|
sDeviceName
|
||||||
|
|
||||||
|
The name of this device.
|
||||||
|
|
||||||
|
deviceType
|
||||||
|
|
||||||
|
This field must be RTC_M48T08.
|
||||||
|
|
||||||
|
pDeviceFns
|
||||||
|
|
||||||
|
The device interface control table. This must be m48t08_fns.
|
||||||
|
|
||||||
|
deviceProbe
|
||||||
|
|
||||||
|
This is the address of the routine which probes to see if the device
|
||||||
|
is present.
|
||||||
|
|
||||||
|
pDeviceParams
|
||||||
|
|
||||||
|
This is ignored and should be NULL.
|
||||||
|
|
||||||
|
ulCtrlPort1
|
||||||
|
|
||||||
|
This field is the base address of the RTC area of the chip. The
|
||||||
|
NVRAM portion of the chip is ignored.
|
||||||
|
|
||||||
|
ulCtrlPort2
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
ulDataPort
|
||||||
|
|
||||||
|
This field is ignored.
|
||||||
|
|
||||||
|
|
||||||
|
getRegister
|
||||||
|
setRegister
|
||||||
|
|
||||||
|
These follow standard conventions.
|
||||||
|
|
||||||
37
c/src/libchip/rtc/STATUS
Normal file
37
c/src/libchip/rtc/STATUS
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
General
|
||||||
|
=======
|
||||||
|
|
||||||
|
+ It would be nice to utilize the interrupt capabilities of some
|
||||||
|
RTC parts. This could be used to trigger checking the software
|
||||||
|
clock against the hardware clock.
|
||||||
|
|
||||||
|
+ The periodic capability of most RTCs is not suitable for use
|
||||||
|
as a general purpose flexible clock tick source. For example,
|
||||||
|
many RTCs generate only a handful of periods with 100 Hz being the
|
||||||
|
most frequent.
|
||||||
|
|
||||||
|
+ The tick field is not set on get. Anything smaller than a second
|
||||||
|
is ignored on set and get operations.
|
||||||
|
|
||||||
|
+ Day of week is ignored since RTEMS does not set it internally.
|
||||||
|
|
||||||
|
+ There is no attempt in RTEMS to know about time zones.
|
||||||
|
|
||||||
|
Harris ICM7170
|
||||||
|
==============
|
||||||
|
|
||||||
|
+ Untested.
|
||||||
|
|
||||||
|
+ Interrupt capabilities are ignored.
|
||||||
|
|
||||||
|
Mostek 48T08
|
||||||
|
============
|
||||||
|
|
||||||
|
+ Untested.
|
||||||
|
|
||||||
|
+ NVRAM is ignored.
|
||||||
|
|
||||||
61
c/src/libchip/rtc/icm7170_reg.c
Normal file
61
c/src/libchip/rtc/icm7170_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _ICM7170_MULTIPLIER
|
||||||
|
#define _ICM7170_MULTIPLIER 1
|
||||||
|
#define _ICM7170_NAME(_X) _X
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_ICM7170_TYPE *)((_base) + ((_reg) * _ICM7170_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICM7170 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _ICM7170_NAME(icm7170_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_ICM7170_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ICM7170 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _ICM7170_NAME(icm7170_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_ICM7170_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
24
c/src/libchip/rtc/icm7170_reg2.c
Normal file
24
c/src/libchip/rtc/icm7170_reg2.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 2
|
||||||
|
#define _ICM7170_NAME(_X) _X##_2
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
24
c/src/libchip/rtc/icm7170_reg4.c
Normal file
24
c/src/libchip/rtc/icm7170_reg4.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 4
|
||||||
|
#define _ICM7170_NAME(_X) _X##_4
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
24
c/src/libchip/rtc/icm7170_reg8.c
Normal file
24
c/src/libchip/rtc/icm7170_reg8.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the icm7170 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _ICM7170_MULTIPLIER 8
|
||||||
|
#define _ICM7170_NAME(_X) _X##_8
|
||||||
|
#define _ICM7170_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "icm7170_reg.c"
|
||||||
|
|
||||||
61
c/src/libchip/rtc/m48t08_reg.c
Normal file
61
c/src/libchip/rtc/m48t08_reg.c
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are only byte-aligned (no address gaps)
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#ifndef _M48T08_MULTIPLIER
|
||||||
|
#define _M48T08_MULTIPLIER 1
|
||||||
|
#define _M48T08_NAME(_X) _X
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
|
||||||
|
(_M48T08_TYPE *)((_base) + ((_reg) * _M48T08_MULTIPLIER ))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* M48T08 Get Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned8 _M48T08_NAME(m48t08_get_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_M48T08_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
return *port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* M48T08 Set Register Routine
|
||||||
|
*/
|
||||||
|
|
||||||
|
void _M48T08_NAME(m48t08_set_register)(
|
||||||
|
unsigned32 ulCtrlPort,
|
||||||
|
unsigned8 ucRegNum,
|
||||||
|
unsigned8 ucData
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_M48T08_TYPE *port;
|
||||||
|
|
||||||
|
port = CALCULATE_REGISTER_ADDRESS( ulCtrlPort, ucRegNum );
|
||||||
|
|
||||||
|
*port = ucData;
|
||||||
|
}
|
||||||
24
c/src/libchip/rtc/m48t08_reg2.c
Normal file
24
c/src/libchip/rtc/m48t08_reg2.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 16-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 2
|
||||||
|
#define _M48T08_NAME(_X) _X##_2
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
24
c/src/libchip/rtc/m48t08_reg4.c
Normal file
24
c/src/libchip/rtc/m48t08_reg4.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 32-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 4
|
||||||
|
#define _M48T08_NAME(_X) _X##_4
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
24
c/src/libchip/rtc/m48t08_reg8.c
Normal file
24
c/src/libchip/rtc/m48t08_reg8.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file contains a typical set of register access routines which may be
|
||||||
|
* used with the m48t08 chip if accesses to the chip are as follows:
|
||||||
|
*
|
||||||
|
* + registers are accessed as bytes
|
||||||
|
* + registers are on 64-bit boundaries
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1997.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
* Copyright assigned to U.S. Government, 1994.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define _M48T08_MULTIPLIER 8
|
||||||
|
#define _M48T08_NAME(_X) _X##_8
|
||||||
|
#define _M48T08_TYPE unsigned8
|
||||||
|
|
||||||
|
#include "m48t08_reg.c"
|
||||||
|
|
||||||
Reference in New Issue
Block a user