예제 #1
0
def payload(channel, red, blue, _esc=pf_rc.ESC.MODE, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for a Combo Direct Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.DIR
    nibble3 = red | (blue << 2)
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #2
0
def payload(channel, function, _esc=pf_rc.ESC.MODE, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for an Extended Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.EXT
    nibble3 = function
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #3
0
def payload(channel, red, blue, _esc=pf_rc.ESC.MODE, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for a Combo Direct Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.DIR
    nibble3 = red | (blue << 2)
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #4
0
def payload(channel, function, _esc=pf_rc.ESC.MODE, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for an Extended Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.EXT
    nibble3 = function
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #5
0
def payload(channel, mode, output, data, _esc=pf_rc.ESC.MODE, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for a Single Output Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.SNGL | (mode << 1) | output
    nibble3 = data
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #6
0
def payload(channel, red, blue, _esc=pf_rc.ESC.PWM, _addr=pf_rc.ADDR.DEF):
    """Returns the payload for a Combo PWM Mode command."""
    nibble1 = _addr | _esc | channel
    nibble2 = blue
    nibble3 = red
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4
예제 #7
0
def payload(channel,
            mode,
            output,
            data,
            _esc=pf_rc.ESC.MODE,
            _addr=pf_rc.ADDR.DEF):
    """Returns the payload for a Single Output Mode command."""
    nibble1 = _esc | channel
    nibble2 = _addr | pf_rc.MODE.SNGL | (mode << 1) | output
    nibble3 = data
    nibble4 = pf_rc.lrc(nibble1, nibble2, nibble3)
    return nibble1, nibble2, nibble3, nibble4