
#include "ds1287.h"
#include "mcs85bus.h"
#include "binary.h"

void DS1287Init(void) {

  WriteMCS85(REGISTERA, b00101000);
  WriteMCS85(REGISTERB, b00001100);  

}


unsigned int DS1287GetYear(void) {
  unsigned int y;
  y = ReadMCS85( CENTURY ) * 100;
  y +=ReadMCS85( YEAR );
  return y;
}


// dont set the year, I forbid thee.
