예제 #1
0
파일: wiggler.c 프로젝트: klammerj/urjtag
static int
wiggler_get_tdo (urj_cable_t *cable)
{
    int status;

    urj_tap_parport_set_data (cable->link.port, PRM_TRST_LVL (cable) |
                              PRM_TCK_INACT (cable) |
                              PRM_UNUSED_BITS (cable));
    urj_tap_cable_wait (cable);

    status = urj_tap_parport_get_status (cable->link.port);
    if (status == -1)
        return -1;

    return (status & (PRM_TDO_ACT (cable) | PRM_TDO_INACT (cable)))
             ^ PRM_TDO_ACT (cable) ? 0 : 1;
}
예제 #2
0
파일: triton.c 프로젝트: bgiffel/urjtag
static int
triton_get_tdo (urj_cable_t *cable)
{
    int trst = (PARAM_SIGNALS (cable) & URJ_POD_CS_TRST) ? 1 : 0;
    int sreset = (PARAM_SIGNALS (cable) & URJ_POD_CS_RESET) ? 1 : 0;
    int status;

    urj_tap_parport_set_data (cable->link.port,
                              (trst << TRST) | (sreset << SRESET) | (0 << TCK));
    PARAM_SIGNALS (cable) &=
        ~(URJ_POD_CS_TDI | URJ_POD_CS_TCK | URJ_POD_CS_TMS);

    urj_tap_cable_wait (cable);

    status = urj_tap_parport_get_status (cable->link.port);
    if (status == -1)
        return status;

    return (status >> TDO) & 1;
}