Description: 本驱动程序在linux2.6.17中测试通过。yangxing msn:lelma_yx@hotmail.com
希望对SPI操作的朋友有所帮助。
一、工作方式:
从设备:SPI为MASTER模式
S3C2410:SPI为SLAVE模式+DMA
二、工作流程
1.S3C2410从接收:当从设备发送数据时,S3C2410利用DMA方式收数,收到指定长度的数据,则进入DMA中断,将接收的数据拷出。
2.S3C2410从发送:当S3C2410需要发送,首先由RTS请求发送,然后等待从设备应答CTS,当从设备应答CTS时,进入外部中断,启动DMA发送,发送完成,再次进入从接收状态。
三、文件位置
spi_dma_slave.c
spi_dma_slave.h
circular_buf.c
circular_buf.h
等文件存放入driver/char/目录
dma.c存放于arch/arm/mach-s3c2410/目录
dma.h存放于include/arm-asm/mach-s3c2410/目录
四、使用环境
1.arm-linux-gcc-3.4.1-the driver linux2.6.17 in which the test. Yangxing msn : lelma_yx@hotmail.com hope to operate SPI friends help. 1, mode of work : from equipment : SPI for the S3C2410 MASTER mode : SPI for SLAVE + DMA mode 2, workflow 1.S3C2410 from receiving : When sending data from the device, using DMA S3C2410 debt, the length of the designated data DMA will enter the interruption will receive unfettered access to the data. 2.S3C2410 from this : When S3C2410 need this, the first request sent by the RTS, Then wait for the response from CTS equipment, when the equipment response from CTS, access to external interrupt start DMA sent, Send completed, re-entered, from receiving state. 3. Position papers spi_dma_slave.c spi_dma_slave.h circul ar_buf.c circular_buf.h documents onto the driver / char / Contents Platform: |
Size: 17368 |
Author:y |
Hits:
Description: 在linux环境下,对mapinfo格式地图操作(包括读、写等)的库文件以及源代码,用arm-linux-gcc编译过的。我就是用它完成了我们学校地图的显示及一些操作功能,平台是三星的s3c2410.-the linux environment, the right to operate MapInfo format maps (including reading, writing) of the library and source code, using arm- linux-gcc compiler before. I was using it completed a map of our school and show some operating functions, the platform of Samsung's s3c2410. Platform: |
Size: 5010432 |
Author:张明杰 |
Hits:
Description: 1、将makefile中的
CROSS =/usr/local/arm/2.95.3/bin/arm-linux-
CFLAGS+=-I/usr/local/src/2.4.18-rmk7/include
CFLAGS+=-I/usr/local/src/2.4.18-rmk7/include/linux
CFLAGS+=-I/usr/local/arm/2.95.3/arm-linux/include
路径改为你宿主机上的。
2、#make,来编译驱动模块。
3、#export PATH=$PATH:/usr/local/arm/2.95.3/bin //取决于你宿主机上的交叉编译工具路径
#arm-linux-gcc -o gpio_test gpio_test.c //编译应用程序
最终在你的当前文件夹下会生成gpiodrv.o与gpio_test两个文件。
4、#mkdir /tmp/1
5、通过ftp的方法,把gpio_test与gpiodrv.o文件下载到你的开发板上的/tmp/1目录中。
6、#mknod /dev/gpio c 220 0 //创建文件节点
#insmod gpiodrv.o
#chmod +x gpio_test
#./gpio_test
然后,就可以看到四个LED灯在闪烁了。:)-1, the makefile in the CROSS =/usr/local/arm/2.95.3/bin/arm-linux- CFLAGS+ =- I/usr/local/src/2.4.18-rmk7/include CFLAGS+ =- I/usr/local/src/2.4.18-rmk7/include/linux CFLAGS+ =- I/usr/local/arm/2.95.3/arm-linux/include changed the path on your host. 2,# make, to compile driver modules. 3,# export PATH = $ PATH:/usr/local/arm/2.95.3/bin// depends on your host on the path of the cross compiler tool# arm-linux-gcc-o gpio_test gpio_test.c// compile the application procedures for the ultimate in your current folder will be generated under the two documents gpiodrv.o and gpio_test. 4,# mkdir/tmp/1 5, through the ftp way to gpiodrv.o File Download gpio_test with the development of your board/tmp/1 directory. 6,# mknod/dev/gpio c 220 0// create a file node# insmod gpiodrv.o# chmod+ x gpio_test#./Gpio_test then four LED lights can be seen in the flicker of. :) Platform: |
Size: 9216 |
Author:马工 |
Hits:
Description: 我的教案,arm-linux-gcc工具链制作方式之一。-My lesson plans, arm-linux-gcc tool chain produced one of the ways. Platform: |
Size: 2048 |
Author:汤剑 |
Hits:
Description: 程序代码使用说明:
(1)所有源代码目录下都提供了Makefile(非Qt),或者.pro(Qt),或者更详细的说明(第7章)。作为对比,也可以参考在书中的对应章节采用直接gcc命令的编译方法,来学习如何编写Makefile。
(2)Makefile中默认情况下采用“CC=gcc”或者“CPP=g++”的设置,交叉编译时请使用“ make CC=arm-linux-gcc CPP=arm-linux-g++”(假设你使用的是光盘中提供的arm-linux-gcc交叉编译工具链)或类似命令。当然,也可以修改这些Makefile。
(3)Qt程序的交叉编译请参考本书第2章:可以利用qmake自动生成用于交叉编译的Makefile。当然,也可以采用(2)的方法,或者直接修改Makefile。
(4)所有代码都在Redhat9和gcc3.4.1/arm-linux-gcc3.4.1/Qtopia-core-4.3.0的环境中编译测试通过。-Code instructions:
(1) all source directory provides Makefile (non Qt) or (Qt. Pro), or a more detailed instructions (chapter 7). In contrast, in the book can also refer the corresponding sections using direct GCC compiler method, the command to learn how to write a Makefile.
(2) in the default Makefile using "CC = GCC" or "CPP = g++" setting, cross-compiling please CC = "you arm- Linux- GCC CPP = arm- Linux- g++" (assuming you use CD in the arm- Linux- GCC cross-compiling toolchain) or similar commands. Of course, also can modify these Makefile.
(3) Qt program cross-compiling please refer to chapter 2: can use qmake automatically generated for cross-compiling of Makefile. Of course, also can use (2) method, or directly modified Makefile.
All code (4) in Redhat9 and gcc3.4.1/arm- Linux gcc3.4.1- Qtopia/says Andrea giancoli of environment 4.3.0- compiled by test. Platform: |
Size: 95232 |
Author:朱信 |
Hits:
Description: linux库 arm-linux-gcc 4.3.2 里面的库,是x86版本的-linux libraries arm-linux-gcc 4.3.2 inside the library, is the x86 version Platform: |
Size: 77824 |
Author:mosquito |
Hits: