require '_h2ph_pre.ph';

unless(defined(&CMD0646U2_REV)) {
    sub CMD0646U2_REV () {	0x05;}
}
unless(defined(&CMD0646U_REV)) {
    sub CMD0646U_REV () {	0x03;}
}
unless(defined(&CMD_CONF)) {
    sub CMD_CONF () {	0x50;}
}
unless(defined(&CMD_CONF_REV_MASK)) {
    sub CMD_CONF_REV_MASK () {	0x03;}
}
unless(defined(&CMD_CONF_DRV0_INTR)) {
    sub CMD_CONF_DRV0_INTR () {	0x04;}
}
unless(defined(&CMD_CONF_DEVID)) {
    sub CMD_CONF_DEVID () {	0x18;}
}
unless(defined(&CMD_CONF_VESAPRT)) {
    sub CMD_CONF_VESAPRT () {	0x20;}
}
unless(defined(&CMD_CONF_DSA1)) {
    sub CMD_CONF_DSA1 () {	0x40;}
}
unless(defined(&CMD_CONF_DSA0)) {
    sub CMD_CONF_DSA0 () {	0x80;}
}
unless(defined(&CMD_CTRL)) {
    sub CMD_CTRL () {	0x51;}
}
unless(defined(&CMD_CTRL_HR_FIFO)) {
    sub CMD_CTRL_HR_FIFO () {	0x01;}
}
unless(defined(&CMD_CTRL_HW_FIFO)) {
    sub CMD_CTRL_HW_FIFO () {	0x02;}
}
unless(defined(&CMD_CTRL_DEVSEL)) {
    sub CMD_CTRL_DEVSEL () {	0x04;}
}
unless(defined(&CMD_CTRL_2PORT)) {
    sub CMD_CTRL_2PORT () {	0x08;}
}
unless(defined(&CMD_CTRL_PAR)) {
    sub CMD_CTRL_PAR () {	0x10;}
}
unless(defined(&CMD_CTRL_HW_HLD)) {
    sub CMD_CTRL_HW_HLD () {	0x20;}
}
unless(defined(&CMD_CTRL_DRV0_RAHEAD)) {
    sub CMD_CTRL_DRV0_RAHEAD () {	0x40;}
}
unless(defined(&CMD_CTRL_DRV1_RAHEAD)) {
    sub CMD_CTRL_DRV1_RAHEAD () {	0x80;}
}
unless(defined(&CMD_DATA_TIM)) {
    sub CMD_DATA_TIM {
	local($chan, $drive) = @_;
	eval q(((($chan) == 0) ? (($drive) == 0) ? 0x54: 0x56 : (($drive) == 0) ? 0x58 : 0x5b));
    }
}
unless(defined(&CMD_ARTTIM23)) {
    sub CMD_ARTTIM23 () {	0x57;}
}
unless(defined(&CMD_ARTTIM23_IRQ)) {
    sub CMD_ARTTIM23_IRQ () {	0x10;}
}
unless(defined(&CMD_ARTTIM23_RHAEAD)) {
    sub CMD_ARTTIM23_RHAEAD {
	local($d) = @_;
	eval q(((0x4) << ($d)));
    }
}
unless(defined(&CMD_DMA_MODE)) {
    sub CMD_DMA_MODE () {	0x71;}
}
unless(defined(&CMD_DMA_MASK)) {
    sub CMD_DMA_MASK () {	0x03;}
}
unless(defined(&CMD_DMA)) {
    sub CMD_DMA () {	0x00;}
}
unless(defined(&CMD_DMA_MULTIPLE)) {
    sub CMD_DMA_MULTIPLE () {	0x01;}
}
unless(defined(&CMD_DMA_LINE)) {
    sub CMD_DMA_LINE () {	0x03;}
}
unless(defined(&CMD_DMA_IRQ)) {
    sub CMD_DMA_IRQ {
	local($chan) = @_;
	eval q((0x4 << ($chan)));
    }
}
unless(defined(&CMD_DMA_IRQ_DIS)) {
    sub CMD_DMA_IRQ_DIS {
	local($chan) = @_;
	eval q((0x10 << ($chan)));
    }
}
unless(defined(&CMD_DMA_RST)) {
    sub CMD_DMA_RST () {	0x40;}
}
unless(defined(&CMD_BICSR)) {
    sub CMD_BICSR () {	0x79;}
}
unless(defined(&CMD_BICSR_80)) {
    sub CMD_BICSR_80 {
	local($chan) = @_;
	eval q((0x01 << ($chan)));
    }
}
unless(defined(&CMD_UDMATIM)) {
    sub CMD_UDMATIM {
	local($channel) = @_;
	eval q((0x73 + (8* ($channel))));
    }
}
unless(defined(&CMD_UDMATIM_UDMA)) {
    sub CMD_UDMATIM_UDMA {
	local($drive) = @_;
	eval q((0x01 << ($drive)));
    }
}
unless(defined(&CMD_UDMATIM_UDMA33)) {
    sub CMD_UDMATIM_UDMA33 {
	local($drive) = @_;
	eval q((0x04 << ($drive)));
    }
}
unless(defined(&CMD_UDMATIM_TIM_MASK)) {
    sub CMD_UDMATIM_TIM_MASK () {	0x3;}
}
unless(defined(&CMD_UDMATIM_TIM_OFF)) {
    sub CMD_UDMATIM_TIM_OFF {
	local($drive) = @_;
	eval q((4+ (($drive) * 2)));
    }
}
1;
