Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
Diff: segment_display/setup.s
- Revision:
- 0:532cb55d6136
diff -r 000000000000 -r 532cb55d6136 segment_display/setup.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/segment_display/setup.s Wed Oct 29 01:21:34 2014 +0000
@@ -0,0 +1,42 @@
+ AREA setup, CODE, READONLY
+;--------------------OVERVIEW------------------------
+; This file contains ARM Assembly language functions to
+; initialize select registers/memory-locations in the
+; LPC1768 to predetermined values. This startup sequence
+; will be used to test the integrity of your program, and
+; IT SHOULD NOT BE ALTERED BY ANY MEANS. Any student
+; attempting to alter this file will be subject to academic
+; dishonesty and any disciplinary actions pertaining
+; thereto.
+;------------------------------------------------------
+; Export function location so that C compiler can find it and link
+ EXPORT setup_sequence
+setup_sequence
+ ;PUSH LINK REGISTER TO STACK
+ PUSH {LR}
+
+ ;INIT PINSEL0
+ LDR R0, =0x4002C000 ;LOAD ADDRESS OF PINSEL0 REGISTER
+ LDR R1, =0x40000000 ;LOAD BITMASK FOR PINSEL0 REGISTER
+ LDR R2, [R0] ;\
+ ORR R2, R1 ;- APPLY BITMASK
+ STR R2, [R0] ;/
+
+ ;INIT PINSEL1
+ LDR R0, =0x4002C004 ;LOAD ADDRESS OF PINSEL1 REGISTER
+ LDR R1, =0x00054015 ;LOAD BITMASK FOR PINSEL1 REGISTER
+ LDR R2, [R0] ;\
+ ORR R2, R1 ;- APPLY BITMASK
+ STR R2, [R0] ;/
+
+ ;INIT PINSEL3
+ LDR R0, =0x4002C00C ;LOAD ADDRESS OF PINSEL3 REGISTER
+ LDR R1, =0x00004510 ;LOAD BITMASK FOR PINSEL4 REGISTER
+ LDR R2, [R0] ;\
+ ORR R2, R1 ;- APPLY BITMASK
+ STR R2, [R0] ;/
+
+ ;RETURN TO MAIN
+ POP {LR}
+ BX LR
+ END
\ No newline at end of file
