Exemplo n.º 1
0
void PS3USB::setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {
        writeBuf[1] = rightDuration;
        writeBuf[2] = rightPower;
        writeBuf[3] = leftDuration;
        writeBuf[4] = leftPower;
        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 2
0
void PS3USB::setLedOn(LEDEnum a) {
        if(a == OFF)
                setLedRaw(0);
        else {
                writeBuf[9] |= (uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1);
                PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
        }
}
Exemplo n.º 3
0
void PS3USB::setRumbleOff() {
        writeBuf[1] = 0x00;
        writeBuf[2] = 0x00; //low mode off
        writeBuf[3] = 0x00;
        writeBuf[4] = 0x00; //high mode off

        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 4
0
void PS3USB::setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower) {
        uint8_t rumbleBuf[EP_MAXPKTSIZE];
        memcpy(rumbleBuf, writeBuf, EP_MAXPKTSIZE);
        rumbleBuf[1] = rightDuration;
        rumbleBuf[2] = rightPower;
        rumbleBuf[3] = leftDuration;
        rumbleBuf[4] = leftPower;
        PS3_Command(rumbleBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 5
0
void PS3USB::setRumbleOff() {
        uint8_t rumbleBuf[EP_MAXPKTSIZE];
        memcpy(rumbleBuf, writeBuf, EP_MAXPKTSIZE);
        rumbleBuf[1] = 0x00;
        rumbleBuf[2] = 0x00; // Low mode off
        rumbleBuf[3] = 0x00;
        rumbleBuf[4] = 0x00; // High mode off
        PS3_Command(rumbleBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 6
0
void PS3USB::setRumbleOn(Rumble mode) {
    /* Still not totally sure how it works, maybe something like this instead?
     * 3 - duration_right
     * 4 - power_right
     * 5 - duration_left
     * 6 - power_left
     */
    if ((mode & 0x30) > 0) {
        writeBuf[1] = 0xfe;
        writeBuf[3] = 0xfe;        
        if (mode == RumbleHigh) {
            writeBuf[2] = 0;//low mode off
            writeBuf[4] = 0xff;//high mode on
        }
        else {
            writeBuf[2] = 0xff;//low mode on
            writeBuf[4] = 0;//high mode off
        }
        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
    }
}
Exemplo n.º 7
0
void PS3USB::setLedToggle(LED a) {
        writeBuf[9] ^= (uint8_t)((pgm_read_byte(&LEDS[(uint8_t)a]) & 0x0f) << 1);
        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 8
0
void PS3USB::setLedRaw(uint8_t value) {
        writeBuf[9] = value << 1;
        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 9
0
void PS3USB::setAllOff() {
        for (uint8_t i = 0; i < PS3_REPORT_BUFFER_SIZE; i++)
                writeBuf[i] = pgm_read_byte(&PS3_REPORT_BUFFER[i]); // Reset buffer

        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}
Exemplo n.º 10
0
void PS3USB::setLedToggle(LED a) {
    writeBuf[9] ^= (uint8_t)(((uint16_t)a & 0x0f) << 1);    
    PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);            
}
Exemplo n.º 11
0
void PS3USB::setLedOff(LED a) {
    writeBuf[9] &= ~((uint8_t)(((uint16_t)a & 0x0f) << 1));    
    PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);               
}
Exemplo n.º 12
0
void PS3USB::setLedOff(LEDEnum a) {
        writeBuf[9] &= ~((uint8_t)((pgm_read_byte(&PS3_LEDS[(uint8_t)a]) & 0x0f) << 1));
        PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);
}