Esempio n. 1
0
static int
wiggler_init (urj_cable_t *cable)
{
    int data;

    if (urj_tap_parport_open (cable->link.port) != URJ_STATUS_OK)
        return -1;

    if ((data = urj_tap_parport_get_data (cable->link.port)) < 0)
    {
        if (urj_tap_parport_set_data (cable->link.port,
                                      PRM_TRST_ACT (cable)
                                      | PRM_TRST_INACT (cable)
                                      | PRM_UNUSED_BITS (cable))
            != URJ_STATUS_OK)
            return URJ_STATUS_FAIL;
        PRM_TRST_LVL (cable) = PRM_TRST_ACT (cable) | PRM_TRST_INACT (cable);
    }
    else
        PRM_TRST_LVL (cable) =
            data & (PRM_TRST_ACT (cable) | PRM_TRST_INACT (cable));

    PRM_SIGNALS (cable) =
        (PRM_TRST_LVL (cable) == PRM_TRST_ACT (cable)) ? URJ_POD_CS_TRST : 0;

    return URJ_STATUS_OK;
}
Esempio n. 2
0
static int
triton_init (urj_cable_t *cable)
{
    if (urj_tap_parport_open (cable->link.port) != URJ_STATUS_OK)
        return URJ_STATUS_FAIL;

    PARAM_SIGNALS (cable) = URJ_POD_CS_TRST | URJ_POD_CS_RESET;
    urj_tap_parport_set_data (cable->link.port, (1 << TRST) | (1 << SRESET));

    return URJ_STATUS_OK;
}