2035
Dependencies: 4DGL-uLCD-SE mbed wave_player
Fork of missile_command by
segment_display/setup.s@3:7e33224a6f1d, 2016-11-09 (annotated)
- Committer:
- tianyeapply
- Date:
- Wed Nov 09 17:04:42 2016 +0000
- Revision:
- 3:7e33224a6f1d
- Parent:
- 0:532cb55d6136
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arvahsu | 0:532cb55d6136 | 1 | AREA setup, CODE, READONLY |
arvahsu | 0:532cb55d6136 | 2 | ;--------------------OVERVIEW------------------------ |
arvahsu | 0:532cb55d6136 | 3 | ; This file contains ARM Assembly language functions to |
arvahsu | 0:532cb55d6136 | 4 | ; initialize select registers/memory-locations in the |
arvahsu | 0:532cb55d6136 | 5 | ; LPC1768 to predetermined values. This startup sequence |
arvahsu | 0:532cb55d6136 | 6 | ; will be used to test the integrity of your program, and |
arvahsu | 0:532cb55d6136 | 7 | ; IT SHOULD NOT BE ALTERED BY ANY MEANS. Any student |
arvahsu | 0:532cb55d6136 | 8 | ; attempting to alter this file will be subject to academic |
arvahsu | 0:532cb55d6136 | 9 | ; dishonesty and any disciplinary actions pertaining |
arvahsu | 0:532cb55d6136 | 10 | ; thereto. |
arvahsu | 0:532cb55d6136 | 11 | ;------------------------------------------------------ |
arvahsu | 0:532cb55d6136 | 12 | ; Export function location so that C compiler can find it and link |
arvahsu | 0:532cb55d6136 | 13 | EXPORT setup_sequence |
arvahsu | 0:532cb55d6136 | 14 | setup_sequence |
arvahsu | 0:532cb55d6136 | 15 | ;PUSH LINK REGISTER TO STACK |
arvahsu | 0:532cb55d6136 | 16 | PUSH {LR} |
arvahsu | 0:532cb55d6136 | 17 | |
arvahsu | 0:532cb55d6136 | 18 | ;INIT PINSEL0 |
arvahsu | 0:532cb55d6136 | 19 | LDR R0, =0x4002C000 ;LOAD ADDRESS OF PINSEL0 REGISTER |
arvahsu | 0:532cb55d6136 | 20 | LDR R1, =0x40000000 ;LOAD BITMASK FOR PINSEL0 REGISTER |
arvahsu | 0:532cb55d6136 | 21 | LDR R2, [R0] ;\ |
arvahsu | 0:532cb55d6136 | 22 | ORR R2, R1 ;- APPLY BITMASK |
arvahsu | 0:532cb55d6136 | 23 | STR R2, [R0] ;/ |
arvahsu | 0:532cb55d6136 | 24 | |
arvahsu | 0:532cb55d6136 | 25 | ;INIT PINSEL1 |
arvahsu | 0:532cb55d6136 | 26 | LDR R0, =0x4002C004 ;LOAD ADDRESS OF PINSEL1 REGISTER |
arvahsu | 0:532cb55d6136 | 27 | LDR R1, =0x00054015 ;LOAD BITMASK FOR PINSEL1 REGISTER |
arvahsu | 0:532cb55d6136 | 28 | LDR R2, [R0] ;\ |
arvahsu | 0:532cb55d6136 | 29 | ORR R2, R1 ;- APPLY BITMASK |
arvahsu | 0:532cb55d6136 | 30 | STR R2, [R0] ;/ |
arvahsu | 0:532cb55d6136 | 31 | |
arvahsu | 0:532cb55d6136 | 32 | ;INIT PINSEL3 |
arvahsu | 0:532cb55d6136 | 33 | LDR R0, =0x4002C00C ;LOAD ADDRESS OF PINSEL3 REGISTER |
arvahsu | 0:532cb55d6136 | 34 | LDR R1, =0x00004510 ;LOAD BITMASK FOR PINSEL4 REGISTER |
arvahsu | 0:532cb55d6136 | 35 | LDR R2, [R0] ;\ |
arvahsu | 0:532cb55d6136 | 36 | ORR R2, R1 ;- APPLY BITMASK |
arvahsu | 0:532cb55d6136 | 37 | STR R2, [R0] ;/ |
arvahsu | 0:532cb55d6136 | 38 | |
arvahsu | 0:532cb55d6136 | 39 | ;RETURN TO MAIN |
arvahsu | 0:532cb55d6136 | 40 | POP {LR} |
arvahsu | 0:532cb55d6136 | 41 | BX LR |
arvahsu | 0:532cb55d6136 | 42 | END |