s3c2440 -- Marquee C+ assembly code

Publisher:gamma13Latest update time:2016-12-23 Source: eefocusKeywords:s3c2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

/*led_asm_c.c*/
#define rGPFCON (*(volatile unsigned *)0x56000050) //Port F control
#define rGPFDAT (*(volatile unsigned *)0x56000054) //Port F data
#define rGPFUP (*(volatile unsigned *)0x56000058) //Pull-up control F
 //GPFCON 8 port
extern int delay(int time); /*Declare assembly function*/

int main()
{
 /*Set GPFCON*/
 rGPFCON &= 0x00ff; //GPF4 - 7 is set to 0
 rGPFCON |= 0x55ff; //GPF4 - 7 is set to output

 /*Set GPFUP*/
 rGPFUP |= 0xff00;

 while(1)
 {
    /*Turn on GPF4*/
    rGPFDAT |= 0xf0; //GPF4 - 7 is set to 1
    rGPFDAT &= 0xe0; //GPF4 is set to 0
    delay(0x1ffffff); //Call the delay program written by the assembly program

     /*Turn on GPF5*/
    rGPFDAT |= 0xf0; //GPF4 - 7 is set to 1
    rGPFDAT &= 0xd0; //GPF5 is set to 0
    delay(0x1ffffff); //Call the delay program written by the assembler

     /*Turn on GPF6*/
    rGPFDAT |= 0xf0; //GPF4 - 7 is set to 1
    rGPFDAT &= 0xb0; //GPF6 is set to 0
    delay(0x1ffffff); //Call the delay program written by the assembler

     /*Turn on GPF7*/
    rGPFDAT |= 0xf0; //Set GPF4 - 7 to 1
    rGPFDAT &= 0x70; //Set GPF7 to 0
    delay(0x1ffffff); //Call the delay program written by the assembly program
 }
}

;delay.s

 EXPORT delay
 AREA delay1,CODE,READONLY; This pseudo instruction defines a code segment delay1. Note the name
; the following delay subroutine

 ENTRY
delay
 ; pass a parameter, put the parameter into r0
 sub r0 ,r0 ,#1
 cmp r0 ,#0x0
 bne delay ; result is not 0 and continue delay
 mov pc ,lr ; return

 END; //end


Keywords:s3c2440 Reference address:s3c2440 -- Marquee C+ assembly code

Previous article:STM32 input and output summary
Next article:What is the maximum input current and output drive current of the STM32 IO port?

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号