我的429工程一共使用了6路SPI,只有SPI3没有工作,其I/O使用情况【MISO-PB4、MOSI-PD6、SCK-PB3】,其中PB3和PB4是程序下载口,在初始化SPI3时已做重映射:
【PIO_PinAFConfig(GPIOB, GPIO_PinSource3, GPIO_AF_SPI3);
GPIO_PinAFConfig(GPIOB, GPIO_PinSource4, GPIO_AF_SPI3);
GPIO_PinAFConfig(GPIOD, GPIO_PinSource6, GPIO_AF_SPI3);】
万用表测过电路硬件连接,都是通的,程序中IO口的宏定义也检查过,也没用错。请问大家有什么建议?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
*/
/* Includes ------------------------------------------------------------------*/
#include "SPI_MSD0_Driver.h"
#include <stdio.h>
#include "diskio.h"
#include "ffconf.h"
//#include "use.h"
/* Private define ------------------------------------------------------------*/
//#define PRINT_INFO 0
/* Private variables ---------------------------------------------------------*/
MSD_CARDINFO SD0_CardInfo;
/*******************************************************************************
* Function Name : MSD0_spi_read_write
* Description : None
* Input : - data:
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
int MSD0_spi_read_write(uint8_t data){
//< Loop while DR register in not emplty
while (SPI_I2S_GetFlagStatus(SPIX, SPI_I2S_FLAG_TXE) == RESET);
//< Send byte through the SPI1 peripheral
SPI_I2S_SendData(SPIX, data);
//< Wait to receive a byte
while (SPI_I2S_GetFlagStatus(SPIX, SPI_I2S_FLAG_RXNE) == RESET);
// < Return the byte read from the SPI bus
return SPI_I2S_ReceiveData(SPIX);
}
/*******************************************************************************
* Function Name : MSD0_SPI_Configuration
* Description : SD Card SPI Configuration
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
void MSD0_SPI_Configuration(void){
GPIO_InitTypeDef GPIO_InitStructure;
SPIX_CLK_INIT(SPIX_CLK, ENABLE);
//RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI3, ENABLE);
RCC_AHB1PeriphClockCmd(SPIX_SCK_GPIO_CLK | SPIX_MISO_GPIO_CLK |
SPIX_MOSI_GPIO_CLK | sFLASH_CS_GPIO_CLK |
sFLASH_CD_GPIO_CLK | sFLASH_PWR_GPIO_CLK , ENABLE);
GPIO_PinAFConfig(SPIX_SCK_GPIO_PORT, SPIX_SCK_SOURCE, SPIX_SCK_AF);
GPIO_PinAFConfig(SPIX_MISO_GPIO_PORT, SPIX_MISO_SOURCE, SPIX_MISO_AF);
GPIO_PinAFConfig(SPIX_MOSI_GPIO_PORT, SPIX_MOSI_SOURCE, SPIX_MOSI_AF);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
/*!< SPI SCK pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_SCK_PIN;
GPIO_Init(SPIX_SCK_GPIO_PORT, &GPIO_InitStructure);
/*!< SPI MOSI pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_MOSI_PIN;
GPIO_Init(SPIX_MOSI_GPIO_PORT, &GPIO_InitStructure);
/*!< SPI MISO pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_MISO_PIN;
GPIO_Init(SPIX_MISO_GPIO_PORT, &GPIO_InitStructure);
/*!< Configure sFLASH Card CS pin in output pushpull mode ********************/
GPIO_InitStructure.GPIO_Pin = sFLASH_CS_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(sFLASH_CS_GPIO_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = sFLASH_CD_PIN; //sd--cd
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; //input
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(sFLASH_CS_GPIO_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = sFLASH_PWR_PIN; //sd-power
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(sFLASH_CS_GPIO_PORT, &GPIO_InitStructure);
MSD0_card_disable();
MSD0_card_power_off();
MSD0_SPIHighSpeed(0);
}
//*****************************************************************************************
//SD 掉电后 将IO口设置成输出=0 模式
void SET_SD_IO_Down(void){
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
/*!< SPI SCK pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_SCK_PIN;
GPIO_Init(SPIX_SCK_GPIO_PORT, &GPIO_InitStructure);
GPIO_ResetBits(SPIX_SCK_GPIO_PORT, SPIX_SCK_PIN);
/*!< SPI MOSI pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_MOSI_PIN;
GPIO_Init(SPIX_MOSI_GPIO_PORT, &GPIO_InitStructure);
GPIO_ResetBits(SPIX_MOSI_GPIO_PORT, SPIX_MOSI_PIN);
/*!< SPI MISO pin configuration */
GPIO_InitStructure.GPIO_Pin = SPIX_MISO_PIN;
GPIO_Init(SPIX_MISO_GPIO_PORT, &GPIO_InitStructure);
GPIO_ResetBits(SPIX_MISO_GPIO_PORT, SPIX_MISO_PIN);
GPIO_InitStructure.GPIO_Pin = sFLASH_CS_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_Init(sFLASH_CS_GPIO_PORT, &GPIO_InitStructure);
GPIO_ResetBits(sFLASH_CS_GPIO_PORT, sFLASH_CS_PIN);
//MSD0_card_enable();
}
//*************************************************************************************
//检测SD 是否插入 =0; 是插入 =1 无SD卡
//*************************************************************************************
unsigned char MSD_JB_SD_insert(void){
return MSD0_card_insert();
}
//*************************************************************************************
//检测磁盘是否插好 0= OK;其余是有问题
//*************************************************************************************
unsigned char disk_detect_OK(void){
if( MSD_JB_SD_insert()==0 ) return disk_initialize(0);
return 1; //卡有问题!
}
//*************************************************************************************
//控制SD的 1=上电,0=掉电!
//*************************************************************************************
void SD_CTRL_Power(char pwr){
if(pwr==OFF){
MSD0_card_power_off();
SET_SD_IO_Down();
}
if(pwr==ON){
MSD0_SPI_Configuration(); // 初始化SD卡的IO
MSD0_card_power_on();
}
}
//******************************************************************************
//判断SD是否插入,然后根据通讯命令 SD 0FF (0N) ,控制电源
void SD_JB_ctrl_Power(void){
if( MSD_JB_SD_insert()){ //未插卡 断电!
SD_CTRL_Power(OFF);
}else{
SD_CTRL_Power(ON);
}
}
/*******************************************************************************
* Function Name : MSD0_SPIHighSpeed
* Description : SD Card Speed Set
* Input : - b_high: 1 = 18MHz, 0 = 281.25Hz
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
void MSD0_SPIHighSpeed(uint8_t b_high){
SPI_InitTypeDef SPI_InitStructure;
SPI_Cmd(SPIX, DISABLE);
SPI_I2S_DeInit(SPIX);
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
/* Speed select */
if(b_high == 0){
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256;
}else{
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
}
SPI_Init(SPIX, &SPI_InitStructure);
SPI_Cmd(SPIX, ENABLE);
}
//*******************************************************************************
//SD卡提速 返回00 OK;
//*******************************************************************************
static int SD_Speed_up(void){
uint8_t r1;
/* Set spi speed high */
MSD0_SPIHighSpeed(1);
/* CRC disable */
r1 = MSD0_send_command(CMD59, 0, 0x01);
if(r1 != 0x00) return r1; /* response error, return r1 */
/* Set the block size */
r1 = MSD0_send_command(CMD16, MSD_BLOCKSIZE, 0xFF); //r1=00 正确
return r1;
}
//*******************************************************************************
// V1卡处理
//*******************************************************************************
static int MSD0_SDV1(void){
uint8_t r1;
uint16_t retry;
SD0_CardInfo.CardType = CARDTYPE_SDV1;
/* End of CMD8, chip disable and dummy byte */
MSD0_card_disable();
MSD0_spi_read_write(DUMMY_BYTE);
/* SD1.0/MMC start initialize */
/* Send CMD55+ACMD41, No-response is a MMC card, otherwise is a SD1.0 card */
for(retry=0; retry<0xFFF; retry++){
r1 = MSD0_send_command(CMD55, 0, 0); /* should be return 0x01 */
if(r1 != 0x01) return r1; //返回值不等于01;
r1 = MSD0_send_command(ACMD41, 0, 0); /* should be return 0x00 */
if(r1 == 0x00) return SD_Speed_up();
}
/* MMC card initialize start */
for(retry=0; retry<0xFFF; retry++){
r1 = MSD0_send_command(CMD1, 0, 0); /* should be return 0x00 */
if(r1 == 0x00){
SD0_CardInfo.CardType = CARDTYPE_MMC;
r1=SD_Speed_up();
return r1;
}
}
return 0; //卡V1.0
}
//*******************************************************************************
// V2卡处理
/* r1=0x01 -> V2.x, read OCR register, check version */
//*******************************************************************************
static int MSD0_SDV2(void){
uint8_t r1;
uint8_t buff[4];
uint16_t retry;
/* 4Bytes returned after CMD8 sent */
buff[0] = MSD0_spi_read_write(DUMMY_BYTE); /* should be 0x00 */
buff[1] = MSD0_spi_read_write(DUMMY_BYTE); /* should be 0x00 */
buff[2] = MSD0_spi_read_write(DUMMY_BYTE); /* should be 0x01 */
buff[3] = MSD0_spi_read_write(DUMMY_BYTE); /* should be 0xAA */
/* End of CMD8, chip disable and dummy byte */
MSD0_card_disable();
MSD0_spi_read_write(DUMMY_BYTE);
/* Check voltage range be 2.7-3.6V */
if(buff[2] !=0x01 || buff[3] !=0xAA) return 1;
retry=0;
while(1){
r1 = MSD0_send_command(CMD55, 0, 0); /* should be return 0x01 */
if(r1 !=0x01) return r1; //是否返回 2?
r1 = MSD0_send_command(ACMD41, 0x40000000, 0); /* should be return 0x00 */
if(r1 == 0x00) break;
/* Timeout return */
if(retry++ > 0xFFF) return 3;
}
/* Read OCR by CMD58 */
r1 = MSD0_send_command_hold(CMD58, 0, 0);
if(r1 !=0x00) return r1; /* response error, return r1 */
buff[0] = MSD0_spi_read_write(DUMMY_BYTE);
buff[1] = MSD0_spi_read_write(DUMMY_BYTE);
buff[2] = MSD0_spi_read_write(DUMMY_BYTE);
buff[3] = MSD0_spi_read_write(DUMMY_BYTE);
/* End of CMD58, chip disable and dummy byte */
MSD0_card_disable();
MSD0_spi_read_write(DUMMY_BYTE);
/* OCR -> CCS(bit30) 1: SDV2HC 0: SDV2 */
if(buff[0] & 0x40){
SD0_CardInfo.CardType = CARDTYPE_SDV2HC;
}else{
SD0_CardInfo.CardType = CARDTYPE_SDV2;
}
/* Set spi speed high */
MSD0_SPIHighSpeed(1);
return 0;
}
//*******************************************************************************
//返回 1 是卡不正确;=0 卡正确!
//*******************************************************************************
static int MSD0_up(void){
uint8_t r1;
uint16_t retry;
MSD0_card_disable();
/* Satrt send 74 clocks at least */
for(retry=0; retry<800; retry++) MSD0_spi_read_write(DUMMY_BYTE);
MSD0_card_enable();
/* Start send CMD0 till return 0x01 means in IDLE state */
for(retry=0; retry<0x7FF; retry++){
r1 = MSD0_send_command(CMD0, 0, 0x95);
if(r1 == 0x01) return 0; //卡正确!
}
return 1; //卡不正确!
}
/*******************************************************************************
* Function Name : MSD0_Init
* Description : SD Card initializtion
* Input : None
* Output : None
* Return : None
* Attention : None
*******************************************************************************/
int MSD0_Init(void){
uint8_t r1;
if(MSD0_up()) return 1;//卡不正确!
/* Get the card type, version */
r1 = MSD0_send_command_hold(CMD8, 0x1AA, 0x87);
if(r1 == 0x05) return MSD0_SDV1(); /* r1=0x05 -> V1.0 */
if(r1 == 0x01) return MSD0_SDV2();
return 1; // r1 是其它值,如何处理的问题??
}
/*******************************************************************************
* Function Name : MSD0_GetCardInfo
* Description : Get SD Card Information
* Input : None
* Output : None
* Return : 0?NO_ERR; TRUE: Error
* Attention : None
*******************************************************************************/
int MSD0_GetCardInfo(PMSD_CARDINFO SD0_CardInfo){
uint8_t r1;
uint8_t CSD_Tab[16];
uint8_t CID_Tab[16];
/* Send CMD9, Read CSD */
r1 = MSD0_send_command(CMD9, 0, 0xFF);
if(r1 != 0x00) return r1;
if(MSD0_read_buffer(CSD_Tab, 16, RELEASE)) return 1;
/* Send CMD10, Read CID */
r1 = MSD0_send_command(CMD10, 0, 0xFF);
if(r1 != 0x00) return r1;
if(MSD0_read_buffer(CID_Tab, 16, RELEASE)) return 2;
/* Byte 0 */
SD0_CardInfo->CSD.CSDStruct = (CSD_Tab[0] & 0xC0) >> 6;
SD0_CardInfo->CSD.SysSpecVersion = (CSD_Tab[0] & 0x3C) >> 2;
SD0_CardInfo->CSD.Reserved1 = CSD_Tab[0] & 0x03;
/* Byte 1 */
SD0_CardInfo->CSD.TAAC = CSD_Tab[1] ;
/* Byte 2 */
SD0_CardInfo->CSD.NSAC = CSD_Tab[2];
/* Byte 3 */
SD0_CardInfo->CSD.MaxBusClkFrec = CSD_Tab[3];
/* Byte 4 */
SD0_CardInfo->CSD.CardComdClasses = CSD_Tab[4] << 4;
/* Byte 5 */
SD0_CardInfo->CSD.CardComdClasses |= (CSD_Tab[5] & 0xF0) >> 4;
SD0_CardInfo->CSD.RdBlockLen = CSD_Tab[5] & 0x0F;
/* Byte 6 */
SD0_CardInfo->CSD.PartBlockRead = (CSD_Tab[6] & 0x80) >> 7;
SD0_CardInfo->CSD.WrBlockMisalign = (CSD_Tab[6] & 0x40) >> 6;
SD0_CardInfo->CSD.RdBlockMisalign = (CSD_Tab[6] & 0x20) >> 5;
SD0_CardInfo->CSD.DSRImpl = (CSD_Tab[6] & 0x10) >> 4;
SD0_CardInfo->CSD.Reserved2 = 0; /* Reserved */
SD0_CardInfo->CSD.DeviceSize = (CSD_Tab[6] & 0x03) << 10;
/* Byte 7 */
SD0_CardInfo->CSD.DeviceSize |= (CSD_Tab[7]) << 2;
/* Byte 8 */
SD0_CardInfo->CSD.DeviceSize |= (CSD_Tab[8] & 0xC0) >> 6;
SD0_CardInfo->CSD.MaxRdCurrentVDDMin = (CSD_Tab[8] & 0x38) >> 3;
SD0_CardInfo->CSD.MaxRdCurrentVDDMax = (CSD_Tab[8] & 0x07);
/* Byte 9 */
SD0_CardInfo->CSD.MaxWrCurrentVDDMin = (CSD_Tab[9] & 0xE0) >> 5;
SD0_CardInfo->CSD.MaxWrCurrentVDDMax = (CSD_Tab[9] & 0x1C) >> 2;
SD0_CardInfo->CSD.DeviceSizeMul = (CSD_Tab[9] & 0x03) << 1;
/* Byte 10 */
SD0_CardInfo->CSD.DeviceSizeMul |= (CSD_Tab[10] & 0x80) >> 7;
SD0_CardInfo->CSD.EraseGrSize = (CSD_Tab[10] & 0x7C) >> 2;
SD0_CardInfo->CSD.EraseGrMul = (CSD_Tab[10] & 0x03) << 3;
/* Byte 11 */
SD0_CardInfo->CSD.EraseGrMul |= (CSD_Tab[11] & 0xE0) >> 5;
SD0_CardInfo->CSD.WrProtectGrSize = (CSD_Tab[11] & 0x1F);
/* Byte 12 */
SD0_CardInfo->CSD.WrProtectGrEnable = (CSD_Tab[12] & 0x80) >> 7;
SD0_CardInfo->CSD.ManDeflECC = (CSD_Tab[12] & 0x60) >> 5;
SD0_CardInfo->CSD.WrSpeedFact = (CSD_Tab[12] & 0x1C) >> 2;
SD0_CardInfo->CSD.MaxWrBlockLen = (CSD_Tab[12] & 0x03) << 2;
/* Byte 13 */
SD0_CardInfo->CSD.MaxWrBlockLen |= (CSD_Tab[13] & 0xc0) >> 6;
SD0_CardInfo->CSD.WriteBlockPaPartial = (CSD_Tab[13] & 0x20) >> 5;
SD0_CardInfo->CSD.Reserved3 = 0;
SD0_CardInfo->CSD.ContentProtectAppli = (CSD_Tab[13] & 0x01);
/* Byte 14 */
SD0_CardInfo->CSD.FileFormatGrouop = (CSD_Tab[14] & 0x80) >> 7;
SD0_CardInfo->CSD.CopyFlag = (CSD_Tab[14] & 0x40) >> 6;
SD0_CardInfo->CSD.PermWrProtect = (CSD_Tab[14] & 0x20) >> 5;
SD0_CardInfo->CSD.TempWrProtect = (CSD_Tab[14] & 0x10) >> 4;
SD0_CardInfo->CSD.FileFormat = (CSD_Tab[14] & 0x0C) >> 2;
SD0_CardInfo->CSD.ECC = (CSD_Tab[14] & 0x03);
/* Byte 15 */
SD0_CardInfo->CSD.CSD_CRC = (CSD_Tab[15] & 0xFE) >> 1;
SD0_CardInfo->CSD.Reserved4 = 1;
if(SD0_CardInfo->CardType == CARDTYPE_SDV2HC){
/* Byte 7 */
SD0_CardInfo->CSD.DeviceSize = (u16)(CSD_Tab[8]) *256;
/* Byte 8 */
SD0_CardInfo->CSD.DeviceSize += CSD_Tab[9] ;
}
SD0_CardInfo->Capacity = SD0_CardInfo->CSD.DeviceSize * MSD_BLOCKSIZE * 1024;
SD0_CardInfo->BlockSize = MSD_BLOCKSIZE;
/* Byte 0 */
SD0_CardInfo->CID.ManufacturerID = CID_Tab[0];
/* Byte 1 */
SD0_CardInfo->CID.OEM_AppliID = CID_Tab[1] << 8;
/* Byte 2 */
SD0_CardInfo->CID.OEM_AppliID |= CID_Tab[2];
/* Byte 3 */
SD0_CardInfo->CID.ProdName1 = CID_Tab[3] << 24;
/* Byte 4 */
SD0_CardInfo->CID.ProdName1 |= CID_Tab[4] << 16;
/* Byte 5 */
SD0_CardInfo->CID.ProdName1 |= CID_Tab[5] << 8;
/* Byte 6 */
SD0_CardInfo->CID.ProdName1 |= CID_Tab[6];
/* Byte 7 */
SD0_CardInfo->CID.ProdName2 = CID_Tab[7];
/* Byte 8 */
SD0_CardInfo->CID.ProdRev = CID_Tab[8];
/* Byte 9 */
SD0_CardInfo->CID.ProdSN = CID_Tab[9] << 24;
/* Byte 10 */
SD0_CardInfo->CID.ProdSN |= CID_Tab[10] << 16;
/* Byte 11 */
SD0_CardInfo->CID.ProdSN |= CID_Tab[11] << 8;
/* Byte 12 */
SD0_CardInfo->CID.ProdSN |= CID_Tab[12];
/* Byte 13 */
SD0_CardInfo->CID.Reserved1 |= (CID_Tab[13] & 0xF0) >> 4;
/* Byte 14 */
SD0_CardInfo->CID.ManufactDate = (CID_Tab[13] & 0x0F) << 8;
/* Byte 15 */
SD0_CardInfo->CID.ManufactDate |= CID_Tab[14];
/* Byte 16 */
SD0_CardInfo->CID.CID_CRC = (CID_Tab[15] & 0xFE) >> 1;
SD0_CardInfo->CID.Reserved2 = 1;
return 0;
}
/*******************************************************************************
* Function Name : MSD0_read_buffer
* Description : None
* Input : - *buff:
* - len:
* - release:
* Output : None
* Return : 0?NO_ERR; TRUE: Error
* Attention : None
*******************************************************************************/
int MSD0_read_buffer(uint8_t *buff, uint16_t len, uint8_t release){
uint8_t r1;
register int retry;
/* Card enable, Prepare to read */
MSD0_card_enable();
/* Wait start-token 0xFE */
retry=0;
while(1){
/* Timeout return */
r1 = MSD0_spi_read_write(DUMMY_BYTE);
if(r1 == 0xFE) break;
if(retry++ >=3000){
MSD0_card_disable();
return 1;
}
}
/* Start reading */
for(retry=0; retry<len; retry++) *(buff+retry) = MSD0_spi_read_write(DUMMY_BYTE);
/* 2bytes dummy CRC */
MSD0_spi_read_write(DUMMY_BYTE);
MSD0_spi_read_write(DUMMY_BYTE);
/* chip disable and dummy byte */
if(release){
MSD0_card_disable();
MSD0_spi_read_write(DUMMY_BYTE);
}
return 0;
}
一周热门 更多>