Changeset cb5e6f68 in rtems


Ignore:
Timestamp:
Jul 29, 1998, 12:03:07 AM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
866c9dd5
Parents:
1177cda
Message:

Renamed control register constants.

Set time->ticks to 0.

Added function table.

Location:
c/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libchip/rtc/m48t08.c

    r1177cda rcb5e6f68  
    3333 */
    3434
    35 #define MK48T08_CONTROL_WRITE  0x80
    36 #define MK48T08_CONTROL_READ   0x40
    37 #define MK48T08_CONTROL_SIGN   0x20
     35#define M48T08_CONTROL_WRITE  0x80
     36#define M48T08_CONTROL_READ   0x40
     37#define M48T08_CONTROL_SIGN   0x20
    3838
    3939/*
     
    6666  unsigned32     value2;
    6767
    68   m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
    69   getReg = RTC_Port_Tbl[ minor ].getRegister;
    70   setReg = RTC_Port_Tbl[ minor ].setRegister;
     68  m48t08 = RTC_Table[ minor ].ulCtrlPort1;
     69  getReg = RTC_Table[ minor ].getRegister;
     70  setReg = RTC_Table[ minor ].setRegister;
    7171
    7272  /*
     
    7575
    7676  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
    77   (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_READ );
     77  (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_READ );
    7878 
    7979  value1 = (*getReg)( m48t08, M48T08_YEAR );
     
    9999  time->second = From_BCD( value1 );
    100100 
     101  time->ticks  = 0;
     102
    101103  /*
    102104   *  Put the RTC back into normal mode.
     
    122124  unsigned8      controlReg;
    123125
    124   m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
    125   getReg = RTC_Port_Tbl[ minor ].getRegister;
    126   setReg = RTC_Port_Tbl[ minor ].setRegister;
     126  m48t08 = RTC_Table[ minor ].ulCtrlPort1;
     127  getReg = RTC_Table[ minor ].getRegister;
     128  setReg = RTC_Table[ minor ].setRegister;
    127129
    128130  /*
     
    131133
    132134  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
    133   (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_WRITE );
     135  (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_WRITE );
    134136 
    135137  if ( time->year >= 2088 )
     
    151153  return 0;
    152154}
     155
     156/*
     157 *  Driver function table
     158 */
     159
     160rtc_fns m48t08_fns = {
     161  m48t08_initialize,
     162  m48t08_get_time,
     163  m48t08_set_time
     164};
     165
  • c/src/libchip/rtc/m48t08.c

    r1177cda rcb5e6f68  
    3333 */
    3434
    35 #define MK48T08_CONTROL_WRITE  0x80
    36 #define MK48T08_CONTROL_READ   0x40
    37 #define MK48T08_CONTROL_SIGN   0x20
     35#define M48T08_CONTROL_WRITE  0x80
     36#define M48T08_CONTROL_READ   0x40
     37#define M48T08_CONTROL_SIGN   0x20
    3838
    3939/*
     
    6666  unsigned32     value2;
    6767
    68   m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
    69   getReg = RTC_Port_Tbl[ minor ].getRegister;
    70   setReg = RTC_Port_Tbl[ minor ].setRegister;
     68  m48t08 = RTC_Table[ minor ].ulCtrlPort1;
     69  getReg = RTC_Table[ minor ].getRegister;
     70  setReg = RTC_Table[ minor ].setRegister;
    7171
    7272  /*
     
    7575
    7676  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
    77   (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_READ );
     77  (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_READ );
    7878 
    7979  value1 = (*getReg)( m48t08, M48T08_YEAR );
     
    9999  time->second = From_BCD( value1 );
    100100 
     101  time->ticks  = 0;
     102
    101103  /*
    102104   *  Put the RTC back into normal mode.
     
    122124  unsigned8      controlReg;
    123125
    124   m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
    125   getReg = RTC_Port_Tbl[ minor ].getRegister;
    126   setReg = RTC_Port_Tbl[ minor ].setRegister;
     126  m48t08 = RTC_Table[ minor ].ulCtrlPort1;
     127  getReg = RTC_Table[ minor ].getRegister;
     128  setReg = RTC_Table[ minor ].setRegister;
    127129
    128130  /*
     
    131133
    132134  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
    133   (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_WRITE );
     135  (*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_WRITE );
    134136 
    135137  if ( time->year >= 2088 )
     
    151153  return 0;
    152154}
     155
     156/*
     157 *  Driver function table
     158 */
     159
     160rtc_fns m48t08_fns = {
     161  m48t08_initialize,
     162  m48t08_get_time,
     163  m48t08_set_time
     164};
     165
Note: See TracChangeset for help on using the changeset viewer.