tsunami_io.hh (3885:fd4067a5b903) | tsunami_io.hh (3932:62e915bb6704) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 71 unchanged lines hidden (view full) --- 80 const std::string &name() const { return _name; } 81 82 /** RTC periodic interrupt event */ 83 RTCEvent event; 84 85 /** Current RTC register address/index */ 86 int addr; 87 | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 71 unchanged lines hidden (view full) --- 80 const std::string &name() const { return _name; } 81 82 /** RTC periodic interrupt event */ 83 RTCEvent event; 84 85 /** Current RTC register address/index */ 86 int addr; 87 |
88 /** should the year be interpreted as BCD? */ 89 bool year_is_bcd; 90 |
|
88 /** Data for real-time clock function */ 89 union { 90 uint8_t clock_data[10]; 91 92 struct { 93 uint8_t sec; 94 uint8_t sec_alrm; 95 uint8_t min; --- 9 unchanged lines hidden (view full) --- 105 106 /** RTC status register A */ 107 uint8_t stat_regA; 108 109 /** RTC status register B */ 110 uint8_t stat_regB; 111 112 public: | 91 /** Data for real-time clock function */ 92 union { 93 uint8_t clock_data[10]; 94 95 struct { 96 uint8_t sec; 97 uint8_t sec_alrm; 98 uint8_t min; --- 9 unchanged lines hidden (view full) --- 108 109 /** RTC status register A */ 110 uint8_t stat_regA; 111 112 /** RTC status register B */ 113 uint8_t stat_regB; 114 115 public: |
113 RTC(const std::string &name, Tsunami* tsunami, time_t t, Tick i); | 116 RTC(const std::string &name, Tsunami* tsunami, 117 const std::vector<int> &t, bool bcd, Tick i); |
114 115 /** RTC address port: write address of RTC RAM data to access */ 116 void writeAddr(const uint8_t data); 117 118 /** RTC write data */ 119 void writeData(const uint8_t data); 120 121 /** RTC read data */ 122 uint8_t readData(); 123 | 118 119 /** RTC address port: write address of RTC RAM data to access */ 120 void writeAddr(const uint8_t data); 121 122 /** RTC write data */ 123 void writeData(const uint8_t data); 124 125 /** RTC read data */ 126 uint8_t readData(); 127 |
128 /** RTC get the date */ 129 std::string getDateString(); 130 |
|
124 /** 125 * Serialize this object to the given output stream. 126 * @param base The base name of the counter object. 127 * @param os The stream to serialize to. 128 */ 129 void serialize(const std::string &base, std::ostream &os); 130 131 /** --- 176 unchanged lines hidden (view full) --- 308 * @return interrupt rate of the RTC 309 */ 310 Tick frequency() const; 311 312 struct Params : public BasicPioDevice::Params 313 { 314 Tick frequency; 315 Tsunami *tsunami; | 131 /** 132 * Serialize this object to the given output stream. 133 * @param base The base name of the counter object. 134 * @param os The stream to serialize to. 135 */ 136 void serialize(const std::string &base, std::ostream &os); 137 138 /** --- 176 unchanged lines hidden (view full) --- 315 * @return interrupt rate of the RTC 316 */ 317 Tick frequency() const; 318 319 struct Params : public BasicPioDevice::Params 320 { 321 Tick frequency; 322 Tsunami *tsunami; |
316 time_t init_time; | 323 std::vector<int> init_time; 324 bool year_is_bcd; |
317 }; | 325 }; |
326 |
|
318 protected: 319 const Params *params() const { return (const Params*)_params; } 320 321 public: 322 /** 323 * Initialize all the data for devices supported by Tsunami I/O. 324 * @param p pointer to Params struct 325 */ --- 33 unchanged lines hidden --- | 327 protected: 328 const Params *params() const { return (const Params*)_params; } 329 330 public: 331 /** 332 * Initialize all the data for devices supported by Tsunami I/O. 333 * @param p pointer to Params struct 334 */ --- 33 unchanged lines hidden --- |