##// END OF EJS Templates
Added Oplayer BSP, Fixed bug on GPIO library(gpiosetval change all the port...
Added Oplayer BSP, Fixed bug on GPIO library(gpiosetval change all the port instead of the desired bit).

File last commit:

r25:b4b05488cb5e default
r60:17402611bd25 dev_alexis
Show More
main.c
41 lines | 857 B | text/x-c | CLexer
#include <stdio.h>
#include <spi.h>
#include <gpio.h>
#include <fat32.h>
#include <mbr.h>
#include <libucfs.h>
#include <sdcard.h>
int main()
{
blkdevice dev;
dikpartition part;
ucdirent dirent;
FAT32fs fs;
sdcardDev sdcard;
//sdcardmake(sdcardDev* sdcard,UHANDLE phy,void (*rcvr_mmc) (UHANDLE,char *,uint32_t),void (*xmit_mmc) (UHANDLE,const char *,uint32_t ),void (*setspeed) (UHANDLE phy,uint32_t speed),uint32_t (*getspeed) (UHANDLE phy))
//sdcardmakeblkdev(&dev);
// mbropen(&dev,&part,1);
spi_t spi = spiopenandconfig(spi2,spi8bits | spimaster |spiclkinhlow | spiclkfirstedge | spimsbfirst,10000,PB15,PB14,PB13,-1);
while(1)
{
spiputw(spi,0x15);
for(volatile int i=0;i<1024*1024;i++);
}
printf("Hello world from project 'SDCARD'! %f\n\r",2.986*4.565);
return 0;
}