from .common import strobe, write_burst
from .util import get_addr


SIDLE = get_addr('SIDLE')
SFTX = get_addr('SFTX')
STX = get_addr('STX')
WRITE_BURST = get_addr("WRITE_BURST")
TXFIFO_BURST = 0x7F

def transmit_packet(spi):
    strobe(spi, SIDLE)
    strobe(spi, SFTX)
    data = [0] * 5
    data[0] = 5
    data[1] = 1
    data[2] = 2
    data[3] = 3
    data[4] = 4
    write_burst(spi, TXFIFO_BURST, data)

