CARME-M4 BSP
V1.5
|
This file contains all the functions prototypes for the SD Card stm324xg_eval_sdio_sd driver firmware library. More...
#include "stm32f4_sdio_sd_lld.h"
Go to the source code of this file.
Data Structures | |
struct | SD_CSD |
Card Specific Data: CSD Register. More... | |
struct | SD_CID |
Card Identification Data: CID Register. More... | |
struct | SD_CardStatus |
SD Card Status. More... | |
struct | SD_CardInfo |
SD Card information. More... | |
Macros | |
#define | SD_CMD_GO_IDLE_STATE ((uint8_t)0) |
SDIO Commands Index. | |
#define | SD_CMD_SEND_OP_COND ((uint8_t)1) |
#define | SD_CMD_ALL_SEND_CID ((uint8_t)2) |
#define | SD_CMD_SET_REL_ADDR ((uint8_t)3) |
#define | SD_CMD_SET_DSR ((uint8_t)4) |
#define | SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5) |
#define | SD_CMD_HS_SWITCH ((uint8_t)6) |
#define | SD_CMD_SEL_DESEL_CARD ((uint8_t)7) |
#define | SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8) |
#define | SD_CMD_SEND_CSD ((uint8_t)9) |
#define | SD_CMD_SEND_CID ((uint8_t)10) |
#define | SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11) |
#define | SD_CMD_STOP_TRANSMISSION ((uint8_t)12) |
#define | SD_CMD_SEND_STATUS ((uint8_t)13) |
#define | SD_CMD_HS_BUSTEST_READ ((uint8_t)14) |
#define | SD_CMD_GO_INACTIVE_STATE ((uint8_t)15) |
#define | SD_CMD_SET_BLOCKLEN ((uint8_t)16) |
#define | SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17) |
#define | SD_CMD_READ_MULT_BLOCK ((uint8_t)18) |
#define | SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19) |
#define | SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20) |
#define | SD_CMD_SET_BLOCK_COUNT ((uint8_t)23) |
#define | SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24) |
#define | SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25) |
#define | SD_CMD_PROG_CID ((uint8_t)26) |
#define | SD_CMD_PROG_CSD ((uint8_t)27) |
#define | SD_CMD_SET_WRITE_PROT ((uint8_t)28) |
#define | SD_CMD_CLR_WRITE_PROT ((uint8_t)29) |
#define | SD_CMD_SEND_WRITE_PROT ((uint8_t)30) |
#define | SD_CMD_SD_ERASE_GRP_START ((uint8_t)32) |
#define | SD_CMD_SD_ERASE_GRP_END ((uint8_t)33) |
#define | SD_CMD_ERASE_GRP_START ((uint8_t)35) |
#define | SD_CMD_ERASE_GRP_END ((uint8_t)36) |
#define | SD_CMD_ERASE ((uint8_t)38) |
#define | SD_CMD_FAST_IO ((uint8_t)39) |
#define | SD_CMD_GO_IRQ_STATE ((uint8_t)40) |
#define | SD_CMD_LOCK_UNLOCK ((uint8_t)42) |
#define | SD_CMD_APP_CMD ((uint8_t)55) |
#define | SD_CMD_GEN_CMD ((uint8_t)56) |
#define | SD_CMD_NO_CMD ((uint8_t)64) |
#define | SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) |
Following commands are SD Card Specific commands. SDIO_APP_CMD should be sent before sending these commands. More... | |
#define | SD_CMD_SD_APP_STAUS ((uint8_t)13) |
#define | SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) |
#define | SD_CMD_SD_APP_OP_COND ((uint8_t)41) |
#define | SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) |
#define | SD_CMD_SD_APP_SEND_SCR ((uint8_t)51) |
#define | SD_CMD_SDIO_RW_DIRECT ((uint8_t)52) |
#define | SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53) |
#define | SD_CMD_SD_APP_GET_MKB ((uint8_t)43) |
Following commands are SD Card Specific security commands. SDIO_APP_CMD should be sent before sending these commands. More... | |
#define | SD_CMD_SD_APP_GET_MID ((uint8_t)44) |
#define | SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45) |
#define | SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46) |
#define | SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47) |
#define | SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48) |
#define | SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18) |
#define | SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25) |
#define | SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38) |
#define | SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49) |
#define | SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48) |
#define | SD_DMA_MODE ((uint32_t)0x00000000) |
#define | SD_PRESENT ((uint8_t)0x01) |
SD detection on its memory slot. | |
#define | SD_NOT_PRESENT ((uint8_t)0x00) |
#define | SDIO_STD_CAPACITY_SD_CARD_V1_1 ((uint32_t)0x00000000) |
Supported SD Memory Cards. | |
#define | SDIO_STD_CAPACITY_SD_CARD_V2_0 ((uint32_t)0x00000001) |
#define | SDIO_HIGH_CAPACITY_SD_CARD ((uint32_t)0x00000002) |
#define | SDIO_MULTIMEDIA_CARD ((uint32_t)0x00000003) |
#define | SDIO_SECURE_DIGITAL_IO_CARD ((uint32_t)0x00000004) |
#define | SDIO_HIGH_SPEED_MULTIMEDIA_CARD ((uint32_t)0x00000005) |
#define | SDIO_SECURE_DIGITAL_IO_COMBO_CARD ((uint32_t)0x00000006) |
#define | SDIO_HIGH_CAPACITY_MMC_CARD ((uint32_t)0x00000007) |
Enumerations | |
enum | SD_Error { SD_CMD_CRC_FAIL = (1), SD_DATA_CRC_FAIL = (2), SD_CMD_RSP_TIMEOUT = (3), SD_DATA_TIMEOUT = (4), SD_TX_UNDERRUN = (5), SD_RX_OVERRUN = (6), SD_START_BIT_ERR = (7), SD_CMD_OUT_OF_RANGE = (8), SD_ADDR_MISALIGNED = (9), SD_BLOCK_LEN_ERR = (10), SD_ERASE_SEQ_ERR = (11), SD_BAD_ERASE_PARAM = (12), SD_WRITE_PROT_VIOLATION = (13), SD_LOCK_UNLOCK_FAILED = (14), SD_COM_CRC_FAILED = (15), SD_ILLEGAL_CMD = (16), SD_CARD_ECC_FAILED = (17), SD_CC_ERROR = (18), SD_GENERAL_UNKNOWN_ERROR = (19), SD_STREAM_READ_UNDERRUN = (20), SD_STREAM_WRITE_OVERRUN = (21), SD_CID_CSD_OVERWRITE = (22), SD_WP_ERASE_SKIP = (23), SD_CARD_ECC_DISABLED = (24), SD_ERASE_RESET = (25), SD_AKE_SEQ_ERROR = (26), SD_INVALID_VOLTRANGE = (27), SD_ADDR_OUT_OF_RANGE = (28), SD_SWITCH_ERROR = (29), SD_SDIO_DISABLED = (30), SD_SDIO_FUNCTION_BUSY = (31), SD_SDIO_FUNCTION_FAILED = (32), SD_SDIO_UNKNOWN_FUNCTION = (33), SD_INTERNAL_ERROR, SD_NOT_CONFIGURED, SD_REQUEST_PENDING, SD_REQUEST_NOT_APPLICABLE, SD_INVALID_PARAMETER, SD_UNSUPPORTED_FEATURE, SD_UNSUPPORTED_HW, SD_ERROR, SD_OK = 0 } |
enum | SDTransferState { SD_TRANSFER_OK = 0, SD_TRANSFER_BUSY = 1, SD_TRANSFER_ERROR } |
SDIO Transfer state. | |
enum | SDCardState { SD_CARD_READY = ((uint32_t)0x00000001), SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002), SD_CARD_STANDBY = ((uint32_t)0x00000003), SD_CARD_TRANSFER = ((uint32_t)0x00000004), SD_CARD_SENDING = ((uint32_t)0x00000005), SD_CARD_RECEIVING = ((uint32_t)0x00000006), SD_CARD_PROGRAMMING = ((uint32_t)0x00000007), SD_CARD_DISCONNECTED = ((uint32_t)0x00000008), SD_CARD_ERROR = ((uint32_t)0x000000FF) } |
SD Card States. | |
Functions | |
void | SD_DeInit (void) |
DeInitializes the SDIO interface. More... | |
SD_Error | SD_Init (void) |
Initializes the SD Card and put it into StandBy State (Ready for data transfer). More... | |
SDTransferState | SD_GetStatus (void) |
Gets the cuurent sd card data transfer status. More... | |
SDCardState | SD_GetState (void) |
Returns the current card's state. More... | |
uint8_t | SD_Detect (void) |
Detect if SD card is correctly plugged in the memory slot. More... | |
SD_Error | SD_PowerON (void) |
Enquires cards about their operating voltage and configures clock controls. More... | |
SD_Error | SD_PowerOFF (void) |
Turns the SDIO output signals off. More... | |
SD_Error | SD_InitializeCards (void) |
Intialises all cards or single card as the case may be Card(s) come into standby state. More... | |
SD_Error | SD_GetCardInfo (SD_CardInfo *cardinfo) |
Returns information about specific card. More... | |
SD_Error | SD_GetCardStatus (SD_CardStatus *cardstatus) |
Enables wide bus opeartion for the requeseted card if supported by card. More... | |
SD_Error | SD_EnableWideBusOperation (uint32_t WideMode) |
Enables wide bus opeartion for the requeseted card if supported by card. More... | |
SD_Error | SD_SelectDeselect (uint32_t addr) |
Selects od Deselects the corresponding card. More... | |
SD_Error | SD_ReadBlock (uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize) |
Allows to read one block from a specified address in a card. The Data transfer can be managed by DMA mode or Polling mode. More... | |
SD_Error | SD_ReadMultiBlocks (uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks) |
Allows to read blocks from a specified address in a card. The Data transfer can be managed by DMA mode or Polling mode. More... | |
SD_Error | SD_ReadMultiBlocksFIXED (uint8_t *readbuff, uint32_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks) |
SD_Error | SD_WriteBlock (uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize) |
Allows to write one block starting from a specified address in a card. The Data transfer can be managed by DMA mode or Polling mode. More... | |
SD_Error | SD_WriteMultiBlocks (uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize, uint32_t NumberOfBlocks) |
Allows to write blocks starting from a specified address in a card. The Data transfer can be managed by DMA mode only. More... | |
SD_Error | SD_WriteMultiBlocksFIXED (uint8_t *writebuff, uint32_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks) |
SDTransferState | SD_GetTransferState (void) |
Gets the cuurent data transfer state. More... | |
SD_Error | SD_StopTransfer (void) |
Aborts an ongoing data transfer. More... | |
SD_Error | SD_Erase (uint32_t startaddr, uint32_t endaddr) |
Allows to erase memory area specified for the given card. More... | |
SD_Error | SD_SendStatus (uint32_t *pcardstatus) |
Returns the current card's status. More... | |
SD_Error | SD_SendSDStatus (uint32_t *psdstatus) |
Returns the current SD card's status. More... | |
SD_Error | SD_ProcessIRQSrc (void) |
Allows to process all the interrupts that are high. More... | |
void | SD_ProcessDMAIRQ (void) |
This function waits until the SDIO DMA data transfer is finished. More... | |
SD_Error | SD_WaitReadOperation (void) |
This function waits until the SDIO DMA data transfer is finished. This function should be called after SDIO_ReadMultiBlocks() function to insure that all data sent by the card are already transferred by the DMA controller. More... | |
SD_Error | SD_WaitWriteOperation (void) |
This function waits until the SDIO DMA data transfer is finished. This function should be called after SDIO_WriteBlock() and SDIO_WriteMultiBlocks() function to insure that all data sent by the card are already transferred by the DMA controller. More... | |
Variables | |
SD_CardInfo | SDCardInfo |
This file contains all the functions prototypes for the SD Card stm324xg_eval_sdio_sd driver firmware library.
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.st.com/software_license_agreement_liberty_v2
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file stm32f4_sdio_sd.h.