中级会员
 
- 积分
- 225
- 金钱
- 225
- 注册时间
- 2015-12-17
- 在线时间
- 44 小时
|

楼主 |
发表于 2016-3-19 15:24:10
|
显示全部楼层
继续问原子哥 我按原例程修改的,只是我没有连接SD卡,用的SPI FLASH 芯片是AT45DB081的, 这样的话,我需要对哪里做些修改呢,目前我只对这两个函数进行了修改uint16_t MAL_Write(uint8_t lun, uint64_t Memory_Offset, uint32_t *Writebuff, uint16_t Transfer_Length)
{
u8 STA;
switch (lun) //这里,根据lun的值确定所要操作的磁盘
{
case 0: //磁盘0为 SPI FLASH盘
STA=0;
AT45DB081_Write_Mainmemory(0x82,(u32) Memory_Offset,(u8*)Writebuff,Transfer_Length);
break;
case 1: //磁盘1为SD卡
STA=1;//SD_WriteDisk((u8*)Writebuff, Memory_Offset>>9, Transfer_Length>>9);
break;
default:
return MAL_FAIL;
}
if(STA!=0)return MAL_FAIL;
return MAL_OK;
}
/*******************************************************************************
* Function Name : MAL_Read
* Description : Read sectors
* Input : None
* Output : None
* Return : Buffer pointer
*******************************************************************************/
uint16_t MAL_Read(uint8_t lun, uint64_t Memory_Offset, uint32_t *Readbuff, uint16_t Transfer_Length)
{
u8 STA=0;
switch (lun) //这里,根据lun的值确定所要操作的磁盘
{
case 0: //磁盘0为 SPI FLASH盘
STA=0;
AT45DB081_Read_Mainmemory((u8*)Readbuff, (u32)Memory_Offset, Transfer_Length);
break;
case 1: //磁盘1为SD卡
STA=1;//SD_ReadDisk((u8*)Readbuff, Memory_Offset>>9, Transfer_Length>>9);
break;
default:
return MAL_FAIL;
}
if(STA!=0)return MAL_FAIL;
return MAL_OK;
}
屏蔽了有关SD的 ,
请指教 |
|