#include "sd_modules.h"
#include "ssd192X.h"
#include "io.h"
#include "system.h"
#include "trace.h"
Defines | |
#define | DELAYFACTOR 1000 |
Functions | |
void | SD_clear_int_1130 (UINT8 d) |
void | SD_clear_int_1132 (UINT8 d) |
void | SD_clear_int () |
void | SD_clear_int_ff () |
UINT8 | SD_wait_cmd_complete_val (UINT8 val) |
UINT8 | SD_wait_cmd_complete () |
UINT8 | SD_wait_cmd_resp_check () |
UINT32 | SD_get_response () |
UINT8 | SD_reset_quick (UINT8 reset_type) |
UINT8 | SD_reset (UINT8 reset_type) |
UINT32 | get_cardstatus (UINT16 rca) |
UINT8 | Card_Detect () |
UINT8 | Select_card (SDCardData *sdcd) |
UINT8 | Deselect_card (void) |
UINT32 | SD_Get_CSD (SDCardData *sdcd) |
UINT8 | SD_Clck_Ctrl (char value) |
void | SD_Clck_Off (void) |
void | SD_Power_On (void) |
void | SD_Power_Off (void) |
void | SD_Host_Ctrl (void) |
UINT8 | SD_Send_CMD (UINT8 cmd, UINT32 cmd_argu, UINT8 cmd_resp_type) |
void | SD_Send_appCMD (UINT16 rca, UINT8 cmd, UINT32 cmd_argu, UINT8 cmd_resp_type) |
UINT8 | SD_base_init () |
UINT8 | SD_init (SDCardData *sdcd) |
UINT8 | set_SD_parameters (UINT16 rca) |
UINT8 | Init_SD (SDCardData *sdcd) |
void | SD_send_csd (UINT16 rca) |
#define DELAYFACTOR 1000 |
Referenced by SD_Get_CSD(), SD_init(), SD_Power_Off(), and SD_Send_appCMD().
UINT8 Card_Detect | ( | void | ) |
References SD_NOT_PRESENT, SD_NOT_READY, SD_OK, SSD_REGRB, and TRACE.
Referenced by Init_SD().
UINT8 Deselect_card | ( | void | ) |
References CMD7, cmd_check, SD_clear_int(), SD_clear_int_ff(), SD_Send_CMD(), and SD_wait_cmd_complete().
myprintf("\r\nSD RCA = 0x%x", SD_RCA);
myprintf("\r\nStatus = 0x%x\r\n", status); // shall be 0x900
References CMD13, cmd_check, r1_resp, SD_clear_int_1130(), SD_CMDline, SD_get_response(), SD_NOT_READY, SD_reset_quick(), SD_Send_CMD(), SD_wait_cmd_complete(), SD_wait_cmd_resp_check(), SSD_REGRB, SSD_REGRW, SSD_REGWB, and SSD_REGWW.
Referenced by SD_write().
UINT8 Init_SD | ( | SDCardData * | sdcd | ) |
References Card_Detect(), SDCardData::rca, SD_init(), Select_card(), set_SD_parameters(), and TRACE.
Referenced by disk_initialize(), and Write_JPEG_data_to_SD().
UINT8 SD_base_init | ( | ) |
References CMD0, NORM_CMD, SD_All, SD_reset(), SD_Send_CMD(), SD_wait_cmd_complete(), and TRACE.
Referenced by SD_init().
UINT8 SD_Clck_Ctrl | ( | char | value | ) |
References SD_CLK_E, SD_OK, SSD_REGRB, and SSD_REGWB.
Referenced by SD_reset().
void SD_clear_int | ( | void | ) |
References SD_clear_int_1130(), and SD_clear_int_1132().
Referenced by Deselect_card(), SD_Get_CSD(), SD_reset(), and Select_card().
void SD_clear_int_1130 | ( | UINT8 | d | ) |
References SSD_REGWB.
Referenced by get_cardstatus(), SD_clear_int(), SD_clear_int_ff(), SD_read(), SD_read_multiple(), SD_Send_CMD(), and SD_write().
void SD_clear_int_1132 | ( | UINT8 | d | ) |
References SSD_REGWB.
Referenced by SD_clear_int(), SD_clear_int_ff(), and SD_Send_CMD().
void SD_clear_int_ff | ( | void | ) |
References SD_clear_int_1130(), and SD_clear_int_1132().
Referenced by Deselect_card(), and Select_card().
UINT32 SD_Get_CSD | ( | SDCardData * | sdcd | ) |
References CMD13, CMD9, cmd_check, cmd_crc_chk, delay_ns(), DELAYFACTOR, SDCardData::erase_size, SDCardData::isSDHC, r1_resp, r2_resp, SDCardData::rca, SD_clear_int(), SD_Send_CMD(), SD_wait_cmd_complete(), SD_wait_cmd_resp_check(), SDCardData::sector_count, SDCardData::size, SSD_REGRB, SSD_REGWB, TRACE, TRACE1, and TRACE2.
Referenced by SD_init().
UINT32 SD_get_response | ( | ) |
References SSD_REGRL.
Referenced by get_cardstatus(), and SD_init().
UINT8 SD_init | ( | SDCardData * | sdcd | ) |
References ACMD41, CMD2, CMD3, CMD8, cmd_check, cmd_crc_chk, delay_ns(), DELAYFACTOR, SDCardData::isSDHC, r2_resp, r6_resp, r7_resp, SDCardData::rca, SD_base_init(), SD_Get_CSD(), SD_get_response(), SD_OK, SD_Send_appCMD(), SD_Send_CMD(), SD_wait_cmd_complete(), SD_wait_cmd_resp_check(), TRACE, TRACE1, and wResp_CMD.
Referenced by Init_SD().
void SD_Power_Off | ( | void | ) |
References delay_ns(), DELAYFACTOR, and SSD_REGWB.
Referenced by SD_reset().
void SD_Power_On | ( | void | ) |
References SSD_REGRB, and SSD_REGWB.
Referenced by SD_reset().
References SD_Clck_Ctrl(), SD_clear_int(), SD_NOT_READY, SD_OK, SD_Power_Off(), SD_Power_On(), SD_reset_quick(), SD_UNKNOWN_E, SSD_REGRB, and SSD_REGWB.
Referenced by SD_base_init().
References SD_NOT_READY, SD_OK, SSD_REGRB, SSD_REGWB, and TRACE1.
Referenced by get_cardstatus(), SD_reset(), and SD_reset_inhibit_DAT().
References CMD55, delay_ns(), DELAYFACTOR, SD_Send_CMD(), SD_wait_cmd_resp_check(), TRACE, TRACE3, and wResp_CMD.
Referenced by SD_init(), and set_SD_parameters().
References SD_clear_int_1130(), SD_clear_int_1132(), SSD_REGRB, SSD_REGWB, TRACE, and TRACE3.
Referenced by Deselect_card(), get_cardstatus(), SD_base_init(), SD_Get_CSD(), SD_init(), SD_read(), SD_read_multiple(), SD_Send_appCMD(), SD_send_csd(), SD_write(), Select_card(), and set_SD_parameters().
void SD_send_csd | ( | UINT16 | rca | ) |
UINT8 SD_wait_cmd_complete | ( | void | ) |
References SD_wait_cmd_complete_val().
Referenced by Deselect_card(), get_cardstatus(), SD_base_init(), SD_Get_CSD(), SD_init(), SD_read(), SD_read_multiple(), SD_write(), Select_card(), and set_SD_parameters().
References SD_NOT_READY, SD_OK, SSD_REGRB, and TRACE.
Referenced by SD_read(), SD_wait_cmd_complete(), and SD_write().
UINT8 SD_wait_cmd_resp_check | ( | void | ) |
References SD_NOT_READY, SD_OK, SSD_REGRB, and TRACE.
Referenced by get_cardstatus(), SD_Get_CSD(), SD_init(), SD_read(), SD_Send_appCMD(), and Select_card().
UINT8 Select_card | ( | SDCardData * | sdcd | ) |
References CMD7, cmd_check, r1b_resp, SDCardData::rca, SD_clear_int(), SD_clear_int_ff(), SD_Send_CMD(), SD_wait_cmd_complete(), and SD_wait_cmd_resp_check().
Referenced by Init_SD().
References ACMD6, CMD16, cmd_check, r1_resp, SD_Send_appCMD(), SD_Send_CMD(), SD_wait_cmd_complete(), and SSD_REGWB.
Referenced by Init_SD().