source: rtems/c/src/libchip/rtc/rtc.h @ 009c235

4.104.114.84.95
Last change on this file since 009c235 was 07e91808, checked in by Joel Sherrill <joel.sherrill@…>, on 07/28/98 at 21:18:11

Added rtc directory.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *  This file contains the Real-Time Clock definitions.
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *
13 *  $Id$
14 */
15
16#ifndef __LIBCHIP_RTC_h
17#define __LIBCHIP_RTC_h
18
19/*
20 *  Types for get and set register routines
21 */
22
23typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
24typedef void      (*setRegister_f)(
25                            unsigned32 port, unsigned8 reg, unsigned8 value);
26typedef unsigned8 (*getData_f)(unsigned32 port);
27typedef void      (*setData_f)(unsigned32 port, unsigned8 value);
28
29typedef struct _rtc_fns {
30  boolean (*deviceProbe)(int minor);
31  void    (*deviceInitialize)(int minor);
32  int     (*deviceGetTime)(int minor, rtems_time_of_day *time);
33  int     (*deviceSetTime)(int minor, rtems_time_of_day *time);
34} rtc_fns;
35
36typedef enum {
37  RTC_M48T08,                  /* SGS-Thomsom M48T08 or M48T18 */
38  RTC_ICM_7170,                /* Harris ICM-7170 */
39  RTC_CUSTOM                   /* BSP specific driver */
40} rtc_devs;
41
42/*
43 * Each field is interpreted thus:
44 *
45 * sDeviceName  This is the name of the device.
46 *
47 * deviceType   This indicates the chip type.
48 *
49 * pDeviceFns   This is a pointer to the set of driver routines to use.
50 *
51 * pDeviceParams This contains either device specific data or a pointer to a
52 *              device specific information table.
53 *
54 * ulCtrlPort1  This is the primary control port number for the device.
55 *
56 * ulCtrlPort2  This is the secondary control port number.
57 *
58 * ulDataPort   This is the port number for the data port of the device
59 *
60 * getRegister  This is the routine used to read register values.
61 *
62 * setRegister  This is the routine used to write register values.
63 */
64
65typedef struct _rtc_tbl {
66  char          *sDeviceName;
67  rtc_devs       deviceType;
68  rtc_fns       *pDeviceFns;
69  boolean      (*deviceProbe)(int minor);
70  void          *pDeviceParams;
71  unsigned32     ulCtrlPort1;
72  unsigned32     ulCtrlPort2;
73  unsigned32     ulDataPort;
74  getRegister_f  getRegister;
75  setRegister_f  setRegister;
76  unsigned int   ulIntVector;
77} rtc_tbl;
78
79extern rtc_tbl        RTC_Port_Tbl[];
80extern unsigned long  RTC_Port_Count;
81
82#endif
83/* end of include file */
Note: See TracBrowser for help on using the repository browser.