From: Erik M. <er...@us...> - 2001-07-16 23:19:42
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv30887 Modified Files: Tag: blob_1_0_9_hack ledasm.S Log Message: - add functions to switch the LED on and off - minor cleanup Index: ledasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/Attic/ledasm.S,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- ledasm.S 2001/07/16 14:55:07 1.1.2.2 +++ ledasm.S 2001/07/16 23:19:40 1.1.2.3 @@ -18,6 +18,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +/* + * Documentation: + * [1] Intel Corporation, "Intel StrongARM SA-1100 Microprocessor + * Developer's Manual", April 1999 + * [2] Intel Corporation, "Intel StrongARM SA-1110 Microprocessor + * Advanced Developer's manual, December 1999 + */ .ident "$Id$" @@ -45,15 +52,44 @@ #warning "FIXME: Include code to turn on one of the LEDs on your board" #endif -GPIO_BASE: .long 0x90040000 + +GPIO_BASE: .long 0x90040000 +#define GPDR 0x00000004 +#define GPSR 0x00000008 +#define GPCR 0x0000000c .globl ledinit + /* initialise LED GPIO and turn LED on. + * clobbers r0 and r1 + */ ledinit: ldr r0, GPIO_BASE + ldr r1, LED + str r1, [r0, #GPDR] /* LED GPIO is output */ + str r1, [r0, #GPSR] /* turn LED on */ + mov pc, lr + + + + +.globl led_on + /* turn LED on. clobbers r0 and r1 */ +led_on: + ldr r0, GPIO_BASE + ldr r1, LED + str r1, [r0, #GPSR] + mov pc, lr + + + + +.globl led_off + /* turn LED off. clobbers r0 and r1 */ +led_off: + ldr r0, GPIO_BASE ldr r1, LED - str r1, [r0, #0x04] /* write GPDR (LED GPIO is output) */ - str r1, [r0, #0x08] /* write GPSR to turn LED on */ - mov pc,lr + str r1, [r0, #GPCR] + mov pc, lr |