##// END OF EJS Templates
Added Simulator target to run code on x86 and debug functions....
Added Simulator target to run code on x86 and debug functions. Fixed some bugs on terminal widget.

File last commit:

r50:144bdeadc77a dev_alexis
r63:68dfbccdd813 dev_alexis
Show More
sdcard-sdio.c
121 lines | 3.0 KiB | text/x-c | CLexer
/*------------------------------------------------------------------------------
-- This file is a part of the libuc, microcontroler library
-- Copyright (C) 2012, Alexis Jeandet
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------
-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@gmail.com
-------------------------------------------------------------------------------*/
#include <i2c.h>
#include <stm32f4xx_usart.h>
#include <stm32f4xx_rcc.h>
#include <stm32f4xx_gpio.h>
#include <stm32f4xx_sdio.h>
#include <gpio.h>
#include <core.h>
#include <sdcard.h>
#include <sdcard-sdio.h>
void sdcardsdiomake(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))
{
sdcard->phy = phy;
sdcard->rcvr_mmc = rcvr_mmc;
sdcard->xmit_mmc = xmit_mmc;
sdcard->setspeed = setspeed;
sdcard->getspeed = getspeed;
}
void sdcardsdiomakeblkdev(blkdevice* dev,sdcardDev* sdcard, blkdevselect_t select,blkdevpower_t power,blkdevdetect_t detect,blkdevwriteprotected_t writeprotected)
{
dev->phy=sdcard;
dev->select=select;
dev->power = power;
dev->detect = detect;
dev->writeprotected = writeprotected;
/*dev->write = sdcarddisk_write;
dev->read = sdcarddisk_read;
dev->ioctl = sdcarddisk_ioctl;
dev->initialize = sdcarddisk_initialize;
dev->status = sdcarddisk_status;*/
}
int sdcardselect (blkdeviceptr _this)
{
}
void sdcarddeselect (blkdeviceptr _this)
{
}
int sdcardwait_ready (sdcardDev* sdcard)
{
}
int sdcardxmit_datablock (sdcardDev* sdcard,const char *buff,char token)
{
}
int sdcardrcvr_datablock (sdcardDev* sdcard,char *buff,uint32_t btr)
{
}
char sdcardsend_cmd (blkdeviceptr _this,char cmd,uint32_t arg)
{
}
DSTATUS sdcarddisk_status (blkdeviceptr _this)
{
return RES_OK;
}
DSTATUS sdcarddisk_initialize (blkdeviceptr _this)
{
return RES_OK;
}
DRESULT sdcarddisk_read (blkdeviceptr _this,char *buff,uint32_t sector,char count)
{
return RES_OK;
}
DRESULT sdcarddisk_write (blkdeviceptr _this,const char *buff,uint32_t sector,char count)
{
}
DRESULT sdcarddisk_ioctl (blkdeviceptr _this,char ctrl,void *buff)
{
return RES_OK;
}