require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&DS1286_SUBSEC)) {
    sub DS1286_SUBSEC () {	0x;}
}
unless(defined(&DS1286_SEC)) {
    sub DS1286_SEC () {	0x1;}
}
unless(defined(&DS1286_MIN)) {
    sub DS1286_MIN () {	0x2;}
}
unless(defined(&DS1286_AMIN)) {
    sub DS1286_AMIN () {	0x3;}
}
unless(defined(&DS1286_HOUR)) {
    sub DS1286_HOUR () {	0x4;}
}
unless(defined(&DS1286_HOUR_12MODE)) {
    sub DS1286_HOUR_12MODE () {	0x40;}
}
unless(defined(&DS1286_HOUR_12HR_PM)) {
    sub DS1286_HOUR_12HR_PM () {	0x20;}
}
unless(defined(&DS1286_HOUR_12HR_MASK)) {
    sub DS1286_HOUR_12HR_MASK () {	0x1f;}
}
unless(defined(&DS1286_HOUR_24HR_MASK)) {
    sub DS1286_HOUR_24HR_MASK () {	0x3f;}
}
unless(defined(&DS1286_AHOUR)) {
    sub DS1286_AHOUR () {	0x5;}
}
unless(defined(&DS1286_DOW)) {
    sub DS1286_DOW () {	0x6;}
}
unless(defined(&DS1286_ADOW)) {
    sub DS1286_ADOW () {	0x7;}
}
unless(defined(&DS1286_DOM)) {
    sub DS1286_DOM () {	0x8;}
}
unless(defined(&DS1286_MONTH)) {
    sub DS1286_MONTH () {	0x9;}
}
unless(defined(&DS1286_MONTH_MASK)) {
    sub DS1286_MONTH_MASK () {	0x3f;}
}
unless(defined(&DS1286_WAVEGEN_MASK)) {
    sub DS1286_WAVEGEN_MASK () {	0xc0;}
}
unless(defined(&DS1286_YEAR)) {
    sub DS1286_YEAR () {	0xa;}
}
unless(defined(&DS1286_CONTROL)) {
    sub DS1286_CONTROL () {	0xb;}
}
unless(defined(&DS1286_TE)) {
    sub DS1286_TE () {	0x80;}
}
unless(defined(&DS1286_INTSWAP)) {
    sub DS1286_INTSWAP () {	0x40;}
}
unless(defined(&DS1286_INTBSRC)) {
    sub DS1286_INTBSRC () {	0x20;}
}
unless(defined(&DS1286_INTAPLS)) {
    sub DS1286_INTAPLS () {	0x10;}
}
unless(defined(&DS1286_WAM)) {
    sub DS1286_WAM () {	0x8;}
}
unless(defined(&DS1286_TDM)) {
    sub DS1286_TDM () {	0x4;}
}
unless(defined(&DS1286_WAF)) {
    sub DS1286_WAF () {	0x2;}
}
unless(defined(&DS1286_TDF)) {
    sub DS1286_TDF () {	0x1;}
}
unless(defined(&DS1286_NREGS)) {
    sub DS1286_NREGS () {	0xd;}
}
unless(defined(&DS1286_NTODREGS)) {
    sub DS1286_NTODREGS () {	0xb;}
}
unless(defined(&DS1286_NVRAM_START)) {
    sub DS1286_NVRAM_START () {	0xe;}
}
unless(defined(&DS1286_NVRAM_SIZE)) {
    sub DS1286_NVRAM_SIZE () {	50;}
}
unless(defined(&DS1286_GETTOD)) {
    sub DS1286_GETTOD {
	my($sc, $regs) = @_;
	eval q( &do { 'int'  &i; 'u_int'  &ctl;  &ctl =  &ds1286_read($sc,  &DS1286_CONTROL);  &ds1286_write($sc,  &DS1286_CONTROL,  &ctl |  &DS1286_TE);  &for ( &i = 0;  &i <  &DS1286_NTODREGS;  &i++) (*$regs)[ &i] =  &ds1286_read($sc,  &i);  &ds1286_write($sc,  &DS1286_CONTROL,  &ctl); }  &while (0););
    }
}
unless(defined(&DS1286_PUTTOD)) {
    sub DS1286_PUTTOD {
	my($sc, $regs) = @_;
	eval q( &do { 'int'  &i; 'u_int'  &ctl;  &ctl =  &ds1286_read($sc,  &DS1286_CONTROL);  &ds1286_write($sc,  &DS1286_CONTROL,  &ctl |  &DS1286_TE);  &for ( &i = 0;  &i <  &DS1286_NTODREGS;  &i++)  &ds1286_write($sc,  &i, (*$regs)[ &i]);  &ds1286_write($sc,  &DS1286_CONTROL,  &ctl); }  &while (0););
    }
}
1;
