Forked PololuLedStrip and modified it to work with the KL25Z. Renamed it to Adafruit_NeoPixel.

Dependents:   idd_hw3 idd_fa15_hw3_lauren_bill_tomas idd_fa15_hw3_lauren_bill_tomas Raiden ... more

Fork of PololuLedStrip by David Grayson

led_strip_write_color.s

Committer:
DavidEGrayson
Date:
2013-02-27
Revision:
0:06475317f283
Child:
4:d3b60bd43811

File content as of revision 0:06475317f283:

    AREA asm_func, CODE, READONLY
    EXPORT led_strip_write_color

led_strip_write_color
    push    {r12, r7}
   
    ldr r12, [r0]      ; Read the next color.
    rbit r12, r12      ; Reverse the order of the bits.
    rev r12, r12       ; Reverse the order of the bytes.
    mov r7, #24        ; Initialize the loop counter register.
    
send_led_strip_bit
    str r3, [r1]       ; Drive the line high.
    rrxs r12, r12      ; Rotate right through carry.
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
        
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
        
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
        
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
        
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    
    it cc                ; If the bit to send it 0...
    strcc r3, [r2]       ; Drive the line low.

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop


    it cs                ; If the bit to send is 1...
    strcs r3, [r2]       ; Drive the line low.
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop   

    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    
    nop
    nop
    nop
    nop
    nop
    nop
    nop   
    
    sub r7, r7, #1               ; Decrement the loop counter.
    cbz r7, led_strip_asm_end    ; If we have sent 24 bits, go to the end.
    b send_led_strip_bit         ; Otherwise, go back and send another bit.
    
led_strip_asm_end
    pop {r12, r7}
    bx lr
    
    END