XDK API  3.6.0
Documentation
Macros | Typedefs | Enumerations | Functions
BCDS_SDCard_Driver.h File Reference
#include "BCDS_Retcode.h"
+ Include dependency graph for BCDS_SDCard_Driver.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define NULL   UINT8_C(0x00)
 
#define SDC_A_COMMAND13   UINT8_C(13 | 0x80)
 
#define SDC_A_COMMAND23   UINT8_C(SDC_COMMAND23| 0x80) /* SET_WR_BLK_ERASE_COUNT (SDC) */
 
#define SDC_A_COMMAND41   UINT8_C(SDC_COMMAND41 | 0x80) /* SEND_OP_COND (SDC) */
 
#define SDC_BLOCK_SEND_TOKEN   UINT8_C(0xFC)
 
#define SDC_CARD_DETECTED   UINT8_C(0)
 
#define SDC_COMMAND0   UINT8_C(0) /* GO_IDLE_STATE */
 
#define SDC_COMMAND1   UINT8_C(1) /* SEND_OP_COND */
 
#define SDC_COMMAND12   UINT8_C(12) /* STOP_TRANSMISSION */
 
#define SDC_COMMAND16   UINT8_C(16) /* SET_BLOCKLEN */
 
#define SDC_COMMAND17   UINT8_C(17) /* READ_SINGLE_BLOCK */
 
#define SDC_COMMAND18   UINT8_C(18) /* READ_MULTIPLE_BLOCK */
 
#define SDC_COMMAND2   UINT8_C(2) /* ALL_SEND_CID */
 
#define SDC_COMMAND23   UINT8_C(23) /* SET_BLOCK_COUNT */
 
#define SDC_COMMAND24   UINT8_C(24) /* WRITE_BLOCK */
 
#define SDC_COMMAND25   UINT8_C(25) /* WRITE_MULTIPLE_BLOCK */
 
#define SDC_COMMAND3   UINT8_C(3) /* SEND_RELATIVE_CHIP_ADDRESS */
 
#define SDC_COMMAND41   UINT8_C(41) /* SEND_OP_COND (ACMD) */
 
#define SDC_COMMAND55   UINT8_C(55) /* APP_CMD */
 
#define SDC_COMMAND58   UINT8_C(58) /* READ_OCR */
 
#define SDC_COMMAND59   UINT8_C(59) /* CRC_ON_OFF_CMD */
 
#define SDC_COMMAND7   UINT8_C(4) /* SELECT_CARD_WITH_RCA */
 
#define SDC_COMMAND8   UINT8_C(8) /* SEND_IF_COND */
 
#define SDC_COMMAND9   UINT8_C(9)
 
#define SDC_CRC_DUMMY_DATAWRITE   UINT8_C(0xFF)
 
#define SDC_CRC_VALUE_COMMAND0   UINT8_C(0x95)
 
#define SDC_CRC_VALUE_COMMAND8   UINT8_C(0x87)
 
#define SDC_CSD_BLOCK_LENGTH   UINT8_C(9)
 
#define SDC_CSD_BLOCK_MASK   UINT8_C(128)
 
#define SDC_CSD_BLOCK_OFFSET   UINT8_C(8)
 
#define SDC_CSD_BLOCK_PARTIAL   UINT8_C(10)
 
#define SDC_CSD_BLOCK_PARTIAL_LENGTH   UINT8_C(64)
 
#define SDC_CSD_BLOCK_PARTIAL_MASK   UINT8_C(124)
 
#define SDC_CSD_BLOCK_PARTIAL_SIZE   UINT8_C(16)
 
#define SDC_CSD_C_SIZE_MASK   UINT8_C(15)
 
#define SDC_CSD_C_SIZE_MULT   UINT8_C(5)
 
#define SDC_CSD_CRC   UINT8_C(0)
 
#define SDC_CSD_CRC_OFFSET   UINT8_C(6)
 
#define SDC_CSD_CRC_SET   UINT8_C(1)
 
#define SDC_CSD_SIZE   UINT8_C(16)
 
#define SDC_CSD_SIZE_OFFSET   UINT8_C(10)
 
#define SDC_CSD_TAAC   UINT8_C(13)
 
#define SDC_CSD_TAAC_OFFSET   UINT8_C(6)
 
#define SDC_CSD_TRAN_SPEED   UINT8_C(11)
 
#define SDC_CSD_TRAN_SPEED_MASK   UINT8_C(224)
 
#define SDC_CSD_TRAN_SPEED_OFFSET   UINT8_C(5)
 
#define SDC_CSD_VDD_W_R_CURR_MAX   UINT8_C(7)
 
#define SDC_CSD_VDD_W_R_CURR_OFFSET   UINT8_C(2)
 
#define SDC_CT_BLOCK   UINT8_C(0x08)
 
#define SDC_CT_HS   UINT32_C(0x1AA)
 
#define SDC_CT_MMC   UINT8_C(0x01)
 
#define SDC_CT_SD1   UINT8_C(0x02)
 
#define SDC_CT_SD2   UINT8_C(0x04)
 
#define SDC_CT_SDC   UINT8_C((SDC_CT_SD1|SDC_CT_SD2))
 
#define SDC_DISK_TYPE_VALIDATE   UINT8_C(0x40)
 
#define SDC_EVEN_PIN   UINT8_C(1)
 
#define SDC_HS_COMMAND_RSP   UINT8_C(2) /* HS Command responds */
 
#define SDC_IDLE_VALUE   UINT32_C(0x40000000) /* Register value setting for IDLE state */
 
#define SDC_LEVEL_SHIFT_HIGH   UINT8_C(1)
 
#define SDC_LEVEL_SHIFT_LOW   UINT8_C(0)
 
#define SDC_ODD_PIN   UINT8_C(0)
 
#define SDC_ONE_BYTE   UINT32_C(1)
 
#define SDC_REF_FRQ   UINT32_C(4000000) /* Reference frequency for USART communication -> 0 */
 
#define SDC_RESPONSE_CHECK   UINT8_C(0x1F)
 
#define SDC_RING_BUFFER_SIZE   UINT8_C(512)
 
#define SDC_SEND_RETRY_COUNT   UINT16_C(2000) /* Value for timeout approximately 50ms */
 
#define SDC_SIGNAL_WAIT_INFINITE   UINT32_C(0x00)
 
#define SDC_SINGLE_BLOCK_LENGTH   UINT32_C(512) /* Number of byte in SDC card sector */
 
#define SDC_SIX_BYTE   UINT32_C(6)
 
#define SDC_SPI_DEFAULT_VALUE   UINT8_C(0xFF)
 
#define SDC_START_COMMAND   UINT8_C(0x40)
 
#define SDC_STOP_TOKEN   UINT8_C(0xFD)
 
#define SDC_TWO_BYTE   UINT32_C(2)
 
#define SDC_VALID_TOKEN_RESP   UINT8_C(0xFE)
 
#define SDC_VALIDATE_ACMD_CLEAR   UINT8_C(0x7F)
 
#define SDC_VALIDATE_ACMD_SET   UINT8_C(0x80)
 
#define SDC_VALUE_EIGHT   UINT8_C(8)
 
#define SDC_VALUE_FIVE   UINT8_C(5)
 
#define SDC_VALUE_FIVEHUNDRED   UINT16_C(500)
 
#define SDC_VALUE_FOUR   UINT8_C(4)
 
#define SDC_VALUE_HUNDRED   UINT8_C(100)
 
#define SDC_VALUE_ONE   UINT8_C(1)
 
#define SDC_VALUE_SEVEN   UINT8_C(7)
 
#define SDC_VALUE_SIXTEEN   UINT8_C(16)
 
#define SDC_VALUE_TEN   UINT8_C(10)
 
#define SDC_VALUE_THREE   UINT8_C(3)
 
#define SDC_VALUE_TWENTYFOUR   UINT8_C(24)
 
#define SDC_VALUE_TWO   UINT8_C(2)
 
#define SDC_VALUE_ZERO   UINT8_C(0)
 
#define SDC_VDD_VALIDATE   UINT8_C(0xAA) /* Voltage level checking command */
 
#define SDC_VOLTAGE_STATUS   UINT8_C(3) /* SD-Card Voltage status */
 
#define SDCARD_DETECT_ENABLE   UINT8_C(1)
 
#define SDCARD_LEVEL_SHIFT_OFF   UINT16_C(1)
 
#define SDCARD_LEVEL_SHIFT_ON   UINT16_C(0)
 
#define SDCARD_MILLI_SECOND_VALUE   (SDCARD_SPI_HIGH_BITRATE / UINT16_C(8000))
 
#define SDCARD_SPI_HIGH_BITRATE   UINT32_C(4000000)
 
#define SDCARD_SPI_LOCATION   UINT16_C(1)
 
#define SDCARD_SPI_LOW_BITRATE   UINT32_C(100000)
 
#define SDCARD_SPI_MODE   UINT16_C(0)
 

Typedefs

typedef enum
SDCardDriver_DiskStatus_E 
SDCardDriver_DiskStatus_T
 
typedef enum
SDCardDriver_ErrorCode_E 
SDCardDriver_ErrorCode_T
 
typedef enum SDCardDriver_Status_E SDCardDriver_Status_T
 

Enumerations

enum  SDCardDriver_DiskStatus_E
 SD card status returned by APIs of SD card driver whether initialized or not. More...
 
enum  SDCardDriver_ErrorCode_E
 Return status for operations using corresponding Retcodes. More...
 
enum  SDCardDriver_Status_E
 SD card status returned by APIs of SD card driver. More...
 

Functions

unsigned long get_fattime (void)
 This function is required by the FAT file system in order to provide timestamps for created files. Since this example does not include a reliable clock we hardcode a value here. More...
 
Retcode_T SDCardDriver_Deinitialize (void)
 The #SDCardDriver_Deinit API is used to deinitialize the SD card module. More...
 
Retcode_T SDCardDriver_DiskInitialize (uint8_t SdDrive)
 The SDCardDriver_DiskInitialize API is used to initialize SD-card Disk sector. The initialization does the following: (1) verify the type of disk and card or disk status. (2) Enables the clock for SD card communication. (3) validating the Disk by passing commands and expected the responds. More...
 
Retcode_T SDCardDriver_DiskIoctl (uint8_t Drive, uint8_t Control, void *Buffer)
 The SDCardDriver_DiskIoctl API is used to have the functionalities to get sector count, sector size, block size. It also used to invalidate the disk initialization. More...
 
Retcode_T SDCardDriver_DiskRead (uint8_t Drive, uint8_t *ReadBuffer, uint32_t Sector, uint32_t ReadCount)
 The SDCardDriver_DiskRead API is used to read data from SD card. More...
 
Retcode_T SDCardDriver_DiskWrite (uint8_t Drive, const uint8_t *WriteBuffer, uint32_t Sector, uint32_t WriteCount)
 The SDCardDriver_DiskWrite API is used to write data into SD card after Disk Initialization has success. More...
 
SDCardDriver_Status_T SDCardDriver_GetDetectStatus (void)
 The SDCardDriver_GetDetectStatus API is used to get the status of the SD card whether the SD card has been inserted or removed. More...
 
SDCardDriver_DiskStatus_T SDCardDriver_GetDiskStatus (uint8_t Drive)
 The SDCardDriver_GetDiskStatus API is used to get the disk initialization status. More...
 
Retcode_T SDCardDriver_Initialize (void)
 The #SDCardDriver_Init API is used to initialize the SD card module. The initialization does the following: (1) SD Card related Port, Pin, mode and dout settings. (2) Enables the clock. (3) Registers the call back function which will be triggered when card inserted or removed. (4) SPI initialization with SD card related parameters. More...
 

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:48 by doxygen 1.8.8