require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_SCMDREG_H_)) {
    eval 'sub _DEV_SCMDREG_H_ () {1;}' unless defined(&_DEV_SCMDREG_H_);
    eval 'sub SCMD_LOW_I2C_ADDR () {0x58;}' unless defined(&SCMD_LOW_I2C_ADDR);
    eval 'sub SCMD_HIGH_I2C_ADDR () {0x61;}' unless defined(&SCMD_HIGH_I2C_ADDR);
    eval 'sub SCMD_REG_FID () {0x;}' unless defined(&SCMD_REG_FID);
    eval 'sub SCMD_REG_ID () {0x1;}' unless defined(&SCMD_REG_ID);
    eval 'sub SCMD_EXPECTED_ID () {0xa9;}' unless defined(&SCMD_EXPECTED_ID);
    eval 'sub SCMD_REG_SLAVE_ADDR () {0x2;}' unless defined(&SCMD_REG_SLAVE_ADDR);
    eval 'sub SCMD_REG_CONFIG_BITS () {0x3;}' unless defined(&SCMD_REG_CONFIG_BITS);
    eval 'sub SCMD_REG_U_I2C_RD_ERR () {0x4;}' unless defined(&SCMD_REG_U_I2C_RD_ERR);
    eval 'sub SCMD_REG_U_I2C_WR_ERR () {0x5;}' unless defined(&SCMD_REG_U_I2C_WR_ERR);
    eval 'sub SCMD_REG_U_BUF_DUMPED () {0x6;}' unless defined(&SCMD_REG_U_BUF_DUMPED);
    eval 'sub SCMD_REG_E_I2C_RD_ERR () {0x7;}' unless defined(&SCMD_REG_E_I2C_RD_ERR);
    eval 'sub SCMD_REG_E_I2C_WR_ERR () {0x8;}' unless defined(&SCMD_REG_E_I2C_WR_ERR);
    eval 'sub SCMD_REG_LOOP_TIME () {0x9;}' unless defined(&SCMD_REG_LOOP_TIME);
    eval 'sub SCMD_REG_SLV_POLL_CNT () {0xa;}' unless defined(&SCMD_REG_SLV_POLL_CNT);
    eval 'sub SCMD_REG_SLV_TOP_ADDR () {0xb;}' unless defined(&SCMD_REG_SLV_TOP_ADDR);
    eval 'sub SCMD_REG_MST_E_ERR () {0xc;}' unless defined(&SCMD_REG_MST_E_ERR);
    eval 'sub SCMD_REG_MST_E_STATUS () {0xd;}' unless defined(&SCMD_REG_MST_E_STATUS);
    eval 'sub SCMD_REG_FSAFE_FAULTS () {0xe;}' unless defined(&SCMD_REG_FSAFE_FAULTS);
    eval 'sub SCMD_REG_REG_OOR_CNT () {0xf;}' unless defined(&SCMD_REG_REG_OOR_CNT);
    eval 'sub SCMD_REG_REG_RO_WRITE_CNT () {0x10;}' unless defined(&SCMD_REG_REG_RO_WRITE_CNT);
    eval 'sub SCMD_REG_GEN_TEST_WORD () {0x11;}' unless defined(&SCMD_REG_GEN_TEST_WORD);
    eval 'sub SCMD_REG_MOTOR_A_INVERT () {0x12;}' unless defined(&SCMD_REG_MOTOR_A_INVERT);
    eval 'sub SCMD_REG_MOTOR_B_INVERT () {0x13;}' unless defined(&SCMD_REG_MOTOR_B_INVERT);
    eval 'sub SCMD_REG_BRIDGE () {0x14;}' unless defined(&SCMD_REG_BRIDGE);
    eval 'sub SCMD_REG_LOCAL_MASTER_LOCK () {0x15;}' unless defined(&SCMD_REG_LOCAL_MASTER_LOCK);
    eval 'sub SCMD_REG_LOCAL_USER_LOCK () {0x16;}' unless defined(&SCMD_REG_LOCAL_USER_LOCK);
    eval 'sub SCMD_REG_MST_E_IN_FN () {0x17;}' unless defined(&SCMD_REG_MST_E_IN_FN);
    eval 'sub SCMD_REG_U_PORT_CLKDIV_U () {0x18;}' unless defined(&SCMD_REG_U_PORT_CLKDIV_U);
    eval 'sub SCMD_REG_U_PORT_CLKDIV_L () {0x19;}' unless defined(&SCMD_REG_U_PORT_CLKDIV_L);
    eval 'sub SCMD_REG_U_PORT_CLKDIV_CTRL () {0x1a;}' unless defined(&SCMD_REG_U_PORT_CLKDIV_CTRL);
    eval 'sub SCMD_REG_E_PORT_CLKDIV_U () {0x1b;}' unless defined(&SCMD_REG_E_PORT_CLKDIV_U);
    eval 'sub SCMD_REG_E_PORT_CLKDIV_L () {0x1c;}' unless defined(&SCMD_REG_E_PORT_CLKDIV_L);
    eval 'sub SCMD_REG_E_PORT_CLKDIV_CTRL () {0x1d;}' unless defined(&SCMD_REG_E_PORT_CLKDIV_CTRL);
    eval 'sub SCMD_REG_U_BUS_UART_BAUD () {0x1e;}' unless defined(&SCMD_REG_U_BUS_UART_BAUD);
    eval 'sub SCMD_REG_FSAFE_CTRL () {0x1f;}' unless defined(&SCMD_REG_FSAFE_CTRL);
    eval 'sub SCMD_REG_MA_DRIVE () {0x20;}' unless defined(&SCMD_REG_MA_DRIVE);
    eval 'sub SCMD_REG_MB_DRIVE () {0x21;}' unless defined(&SCMD_REG_MB_DRIVE);
    eval 'sub SCMD_REG_S1A_DRIVE () {0x22;}' unless defined(&SCMD_REG_S1A_DRIVE);
    eval 'sub SCMD_REG_S1B_DRIVE () {0x23;}' unless defined(&SCMD_REG_S1B_DRIVE);
    eval 'sub SCMD_REG_S2A_DRIVE () {0x24;}' unless defined(&SCMD_REG_S2A_DRIVE);
    eval 'sub SCMD_REG_S2B_DRIVE () {0x25;}' unless defined(&SCMD_REG_S2B_DRIVE);
    eval 'sub SCMD_REG_S3A_DRIVE () {0x26;}' unless defined(&SCMD_REG_S3A_DRIVE);
    eval 'sub SCMD_REG_S3B_DRIVE () {0x27;}' unless defined(&SCMD_REG_S3B_DRIVE);
    eval 'sub SCMD_REG_S4A_DRIVE () {0x28;}' unless defined(&SCMD_REG_S4A_DRIVE);
    eval 'sub SCMD_REG_S4B_DRIVE () {0x29;}' unless defined(&SCMD_REG_S4B_DRIVE);
    eval 'sub SCMD_REG_S5A_DRIVE () {0x2a;}' unless defined(&SCMD_REG_S5A_DRIVE);
    eval 'sub SCMD_REG_S5B_DRIVE () {0x2b;}' unless defined(&SCMD_REG_S5B_DRIVE);
    eval 'sub SCMD_REG_S6A_DRIVE () {0x2c;}' unless defined(&SCMD_REG_S6A_DRIVE);
    eval 'sub SCMD_REG_S6B_DRIVE () {0x2d;}' unless defined(&SCMD_REG_S6B_DRIVE);
    eval 'sub SCMD_REG_S7A_DRIVE () {0x2e;}' unless defined(&SCMD_REG_S7A_DRIVE);
    eval 'sub SCMD_REG_S7B_DRIVE () {0x2f;}' unless defined(&SCMD_REG_S7B_DRIVE);
    eval 'sub SCMD_REG_S8A_DRIVE () {0x30;}' unless defined(&SCMD_REG_S8A_DRIVE);
    eval 'sub SCMD_REG_S8B_DRIVE () {0x31;}' unless defined(&SCMD_REG_S8B_DRIVE);
    eval 'sub SCMD_REG_S9A_DRIVE () {0x32;}' unless defined(&SCMD_REG_S9A_DRIVE);
    eval 'sub SCMD_REG_S9B_DRIVE () {0x33;}' unless defined(&SCMD_REG_S9B_DRIVE);
    eval 'sub SCMD_REG_S10A_DRIVE () {0x34;}' unless defined(&SCMD_REG_S10A_DRIVE);
    eval 'sub SCMD_REG_S10B_DRIVE () {0x35;}' unless defined(&SCMD_REG_S10B_DRIVE);
    eval 'sub SCMD_REG_S11A_DRIVE () {0x36;}' unless defined(&SCMD_REG_S11A_DRIVE);
    eval 'sub SCMD_REG_S11B_DRIVE () {0x37;}' unless defined(&SCMD_REG_S11B_DRIVE);
    eval 'sub SCMD_REG_S12A_DRIVE () {0x38;}' unless defined(&SCMD_REG_S12A_DRIVE);
    eval 'sub SCMD_REG_S12B_DRIVE () {0x39;}' unless defined(&SCMD_REG_S12B_DRIVE);
    eval 'sub SCMD_REG_S13A_DRIVE () {0x3a;}' unless defined(&SCMD_REG_S13A_DRIVE);
    eval 'sub SCMD_REG_S13B_DRIVE () {0x3b;}' unless defined(&SCMD_REG_S13B_DRIVE);
    eval 'sub SCMD_REG_S14A_DRIVE () {0x3c;}' unless defined(&SCMD_REG_S14A_DRIVE);
    eval 'sub SCMD_REG_S14B_DRIVE () {0x3d;}' unless defined(&SCMD_REG_S14B_DRIVE);
    eval 'sub SCMD_REG_S15A_DRIVE () {0x3e;}' unless defined(&SCMD_REG_S15A_DRIVE);
    eval 'sub SCMD_REG_S15B_DRIVE () {0x3f;}' unless defined(&SCMD_REG_S15B_DRIVE);
    eval 'sub SCMD_REG_S16A_DRIVE () {0x40;}' unless defined(&SCMD_REG_S16A_DRIVE);
    eval 'sub SCMD_REG_S16B_DRIVE () {0x41;}' unless defined(&SCMD_REG_S16B_DRIVE);
    eval 'sub SCMD_REG_HOLE_1_LOW () {0x42;}' unless defined(&SCMD_REG_HOLE_1_LOW);
    eval 'sub SCMD_REG_HOLE_1_HIGH () {0x4f;}' unless defined(&SCMD_REG_HOLE_1_HIGH);
    eval 'sub SCMD_REG_INV_2_9 () {0x50;}' unless defined(&SCMD_REG_INV_2_9);
    eval 'sub SCMD_REG_INV_10_17 () {0x51;}' unless defined(&SCMD_REG_INV_10_17);
    eval 'sub SCMD_REG_INV_18_25 () {0x52;}' unless defined(&SCMD_REG_INV_18_25);
    eval 'sub SCMD_REG_INV_26_33 () {0x53;}' unless defined(&SCMD_REG_INV_26_33);
    eval 'sub SCMD_REG_BRIDGE_SLV_L () {0x54;}' unless defined(&SCMD_REG_BRIDGE_SLV_L);
    eval 'sub SCMD_REG_BRIDGE_SLV_H () {0x55;}' unless defined(&SCMD_REG_BRIDGE_SLV_H);
    eval 'sub SCMD_REG_HOLE_2_LOW () {0x56;}' unless defined(&SCMD_REG_HOLE_2_LOW);
    eval 'sub SCMD_REG_PAGE_SELECT () {0x6f;}' unless defined(&SCMD_REG_PAGE_SELECT);
    eval 'sub SCMD_REG_HOLE_2_HIGH () {0x6f;}' unless defined(&SCMD_REG_HOLE_2_HIGH);
    eval 'sub SCMD_REG_DRIVER_ENABLE () {0x70;}' unless defined(&SCMD_REG_DRIVER_ENABLE);
    eval 'sub SCMD_DRIVER_ENABLE () {0x1;}' unless defined(&SCMD_DRIVER_ENABLE);
    eval 'sub SCMD_DRIVER_DISABLE () {0x;}' unless defined(&SCMD_DRIVER_DISABLE);
    eval 'sub SCMD_REG_UPDATE_RATE () {0x71;}' unless defined(&SCMD_REG_UPDATE_RATE);
    eval 'sub SCMD_REG_FORCE_UPDATE () {0x72;}' unless defined(&SCMD_REG_FORCE_UPDATE);
    eval 'sub SCMD_REG_E_BUS_SPEED () {0x73;}' unless defined(&SCMD_REG_E_BUS_SPEED);
    eval 'sub SCMD_REG_MASTER_LOCK () {0x74;}' unless defined(&SCMD_REG_MASTER_LOCK);
    eval 'sub SCMD_REG_USER_LOCK () {0x75;}' unless defined(&SCMD_REG_USER_LOCK);
    eval 'sub SCMD_REG_FSAFE_TIME () {0x76;}' unless defined(&SCMD_REG_FSAFE_TIME);
    eval 'sub SCMD_REG_STATUS_1 () {0x77;}' unless defined(&SCMD_REG_STATUS_1);
    eval 'sub SCMD_REG_CONTROL_1 () {0x78;}' unless defined(&SCMD_REG_CONTROL_1);
    eval 'sub SCMD_CONTROL_1_RESTART () {0x1;}' unless defined(&SCMD_CONTROL_1_RESTART);
    eval 'sub SCMD_CONTROL_1_REENUMERATE () {0x2;}' unless defined(&SCMD_CONTROL_1_REENUMERATE);
    eval 'sub SCMD_REG_REM_ADDR () {0x79;}' unless defined(&SCMD_REG_REM_ADDR);
    eval 'sub SCMD_REG_REM_OFFSET () {0x7a;}' unless defined(&SCMD_REG_REM_OFFSET);
    eval 'sub SCMD_REG_REM_DATA_WR () {0x7b;}' unless defined(&SCMD_REG_REM_DATA_WR);
    eval 'sub SCMD_REG_REM_DATA_RD () {0x7c;}' unless defined(&SCMD_REG_REM_DATA_RD);
    eval 'sub SCMD_REG_REM_WRITE () {0x7d;}' unless defined(&SCMD_REG_REM_WRITE);
    eval 'sub SCMD_REG_REM_READ () {0x7e;}' unless defined(&SCMD_REG_REM_READ);
    eval 'sub SCMD_LAST_REG () { &SCMD_REG_REM_READ;}' unless defined(&SCMD_LAST_REG);
    eval 'sub SCMD_REG_SIZE () {0x7f;}' unless defined(&SCMD_REG_SIZE);
    eval 'sub SCMD_REMOTE_ADDR_LOW () {0x50;}' unless defined(&SCMD_REMOTE_ADDR_LOW);
    eval 'sub SCMD_REMOTE_ADDR_HIGH () {0x5f;}' unless defined(&SCMD_REMOTE_ADDR_HIGH);
    eval 'sub SCMD_HOLE_VALUE () {0x55;}' unless defined(&SCMD_HOLE_VALUE);
    eval 'sub SCMD_IS_HOLE {
        my($r) = @_;
	    eval q((($r >=  &SCMD_REG_HOLE_1_LOW  && $r <=  &SCMD_REG_HOLE_1_HIGH) || ($r >=  &SCMD_REG_HOLE_2_LOW  && $r <=  &SCMD_REG_HOLE_2_HIGH)));
    }' unless defined(&SCMD_IS_HOLE);
    eval 'sub SCMD_MASTER_LOCK_UNLOCKED () {0x9b;}' unless defined(&SCMD_MASTER_LOCK_UNLOCKED);
    eval 'sub SCMD_USER_LOCK_UNLOCKED () {0x5c;}' unless defined(&SCMD_USER_LOCK_UNLOCKED);
    eval 'sub SCMD_ANY_LOCK_LOCKED () {0x;}' unless defined(&SCMD_ANY_LOCK_LOCKED);
}
1;
