日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁(yè) > 芯聞號(hào) > 充電吧
[導(dǎo)讀]今天開(kāi)始學(xué)習(xí)ARM11,使用的是飛凌的OK6410A開(kāi)發(fā)板.?平臺(tái)信息:采用的是三星的S3C6410,板載256MB DDR,2G NAND.Win7 32bitRVDS 2.2??1.像以前學(xué)習(xí)51

今天開(kāi)始學(xué)習(xí)ARM11,使用的是飛凌的OK6410A開(kāi)發(fā)板.

?

平臺(tái)信息:

采用的是三星的S3C6410,板載256MB DDR,2G NAND.

Win7 32bit

RVDS 2.2

?

?

1.像以前學(xué)習(xí)51時(shí)一樣,首先點(diǎn)亮一個(gè)LED.

這是啟動(dòng)文件,最簡(jiǎn)單的,就聲明一個(gè)代碼段,跳轉(zhuǎn)到main函數(shù).因?yàn)槭莿倓倢W(xué)習(xí),因此暫時(shí)不去深究.

?

?

2.主要的代碼,就一個(gè)延時(shí)函數(shù),一個(gè)LED? IO初始化函數(shù),一個(gè)主函數(shù),非常簡(jiǎn)單的.

LED0-LED4用的是?GPIOM0-GPIOM3

?

GPIOM寄存器

主要設(shè)置的就是配置寄存器了

?

?

?

?

#include"s3c6410_map.h"

?

?

void led_init(void)

{

GPIOM->CON= 0x1111;

GPIOM->DAT= 0;

}

?

void Delay(u32 n)

{

u32i;

while(n--)

{

for(i= 0;i < 2000000;i ++);

}

}

?

void Main(void)

{

u8i;

led_init();

while(1)

{

for(i= 0;i < 4;i++)

{

GPIOM->DAT= ~(1 << i);

Delay(3);

}

?

}

}

?

?

3.寄存器映射,仿照的STM32官方的庫(kù)函數(shù),之前學(xué)習(xí)STM32感覺(jué)這種采用指針的操作方式非常方便,比起STM32的寄存器設(shè)置,S3C6410????????相對(duì)來(lái)說(shuō)非常的簡(jiǎn)單.?

?


//創(chuàng)建時(shí)間:20120218

//最后修改時(shí)間:20120218

//說(shuō)明:S3C6410寄存器映射定義

?

?

#ifndef_S3C6410_MAP_H_

#define_S3C6410_MAP_H_

?

//

#define _GPIOM

?

//**********************************************************************************//

//數(shù)據(jù)結(jié)構(gòu)定義

/* Includes------------------------------------------------------------------*/

/* Exported types------------------------------------------------------------*/

typedef signedlong? s32;

typedef signed shorts16;

typedef signedchar? s8;

?

typedef signedlong? const sc32;? /* Read Only */

typedef signed shortconst sc16;? /* Read Only */

typedef signedchar? const sc8;?? /* Read Only */

?

typedef volatilesigned long? vs32;

typedef volatilesigned short vs16;

typedef volatilesigned char? vs8;

?

typedef volatilesigned long? const vsc32;? /* Read Only */

typedef volatilesigned short const vsc16;? /* Read Only*/

typedef volatilesigned char? const vsc8;?? /* Read Only */

?

typedef unsignedlong? u32;

typedef unsignedshort u16;

typedef unsignedchar? u8;

?

typedef unsignedlong? const uc32;? /* Read Only */

typedef unsignedshort const uc16;? /* Read Only */

typedef unsignedchar? const uc8;?? /* Read Only */

?

typedef volatileunsigned long? vu32;

typedef volatileunsigned short vu16;

typedef volatileunsigned char? vu8;

?

typedef volatileunsigned long? const vuc32;? /* Read Only */

typedef volatileunsigned short const vuc16;? /* Read Only*/

typedef volatileunsigned char? const vuc8;?? /* Read Only */

?

typedef enum {FALSE= 0, TRUE = !FALSE} bool;

?

?

//**********************************************************************************//

//GPIO

//外設(shè)寄存器定義

typedef struct

{

u32????????CON;

u32????????DAT;

u32????????PUD;

u32????????CONSLP;????????//可能沒(méi)有

u32????????PUDSLP;????????//可能沒(méi)有

}GPIO_TypeDef;//定義一個(gè)GPIO寄存器結(jié)構(gòu)類型

?

?

//**********************************************************************************//

//GPIO

//外設(shè)基址

#define GPIOM_BASE0x7f008820????????//GPIOM基址

?

?

//**********************************************************************************//

//GPIO

#ifdef _GPIOM

#defineGPIOM????????((GPIO_TypeDef*)GPIOM_BASE)

#endif

?

?

?

#endif

?

?

4,工程建立以及仿真運(yùn)行

工程建立仿真可以參閱國(guó)嵌的OK6410視頻,電驢資源里面有下載.

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉