Search code examples
androidheaderincludespi

mini6410 spi programming using android


i am using android to read spi with spi_s3c.c
this file and its header: spi_s3c.h includes some headers i cant find at include folder presented by company(friendly arm dvd)

for example spi_s3c.h contains these lines:

#include <mach/s3c-dma.h>
#include <mach/map.h>
#include <mach/gpio.h>
#include <plat/regs-gpio.h>
#include <plat/gpio-cfg.h>
#include <plat/spi.h>

s3c-dma.h exists on: DVD\android-kernel-2.6.28.20100724\linux-2.6.28.6-ansroid\arch\plat-s3c\include\ mach\s3c-dma.h

but map.h and gpio.h files dont exist on that path
i dont want to re target these pathes (bec of several included files)
who now where i can get a consistent include folder? thanks.


Solution

  • spi_s3c.c and other driver files can not be compiled separately. instead we should compile them (drivers) as a part of android kernel. During the kernel compilation, all header needed files are available (using cross_compile). make sure that you use the right Linux version to compile the kernel (for example fedora has a complete list of headers we need to compile our android kernel). then we need a gcc compiler installed on this Linux machine. and finally make a compile.