40 #define SDIO_OFFSET (SDIO_BASE - PERIPH_BASE) 45 #define CLKCR_OFFSET (SDIO_OFFSET + 0x04) 46 #define CLKEN_BitNumber 0x08 47 #define CLKCR_CLKEN_BB (PERIPH_BB_BASE + (CLKCR_OFFSET * 32) + (CLKEN_BitNumber * 4)) 52 #define CMD_OFFSET (SDIO_OFFSET + 0x0C) 53 #define SDIOSUSPEND_BitNumber 0x0B 54 #define CMD_SDIOSUSPEND_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (SDIOSUSPEND_BitNumber * 4)) 57 #define ENCMDCOMPL_BitNumber 0x0C 58 #define CMD_ENCMDCOMPL_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ENCMDCOMPL_BitNumber * 4)) 61 #define NIEN_BitNumber 0x0D 62 #define CMD_NIEN_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (NIEN_BitNumber * 4)) 65 #define ATACMD_BitNumber 0x0E 66 #define CMD_ATACMD_BB (PERIPH_BB_BASE + (CMD_OFFSET * 32) + (ATACMD_BitNumber * 4)) 71 #define DCTRL_OFFSET (SDIO_OFFSET + 0x2C) 72 #define DMAEN_BitNumber 0x03 73 #define DCTRL_DMAEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (DMAEN_BitNumber * 4)) 76 #define RWSTART_BitNumber 0x08 77 #define DCTRL_RWSTART_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTART_BitNumber * 4)) 80 #define RWSTOP_BitNumber 0x09 81 #define DCTRL_RWSTOP_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWSTOP_BitNumber * 4)) 84 #define RWMOD_BitNumber 0x0A 85 #define DCTRL_RWMOD_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (RWMOD_BitNumber * 4)) 88 #define SDIOEN_BitNumber 0x0B 89 #define DCTRL_SDIOEN_BB (PERIPH_BB_BASE + (DCTRL_OFFSET * 32) + (SDIOEN_BitNumber * 4)) 96 #define CLKCR_CLEAR_MASK ((uint32_t)0xFFFF8100) 101 #define PWR_PWRCTRL_MASK ((uint32_t)0xFFFFFFFC) 106 #define DCTRL_CLEAR_MASK ((uint32_t)0xFFFFFF08) 111 #define CMD_CLEAR_MASK ((uint32_t)0xFFFFF800) 114 #define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14)) 163 SDIO->POWER = 0x00000000;
164 SDIO->CLKCR = 0x00000000;
165 SDIO->ARG = 0x00000000;
166 SDIO->CMD = 0x00000000;
167 SDIO->DTIMER = 0x00000000;
168 SDIO->DLEN = 0x00000000;
169 SDIO->DCTRL = 0x00000000;
170 SDIO->ICR = 0x00C007FF;
171 SDIO->MASK = 0x00000000;
194 tmpreg =
SDIO->CLKCR;
210 SDIO->CLKCR = tmpreg;
257 SDIO->POWER |= SDIO_PowerState;
316 SDIO->MASK |= SDIO_IT;
321 SDIO->MASK &= ~SDIO_IT;
399 return (uint8_t)(
SDIO->RESPCMD);
414 __IO uint32_t tmp = 0;
421 return (*(
__IO uint32_t *) tmp);
452 tmpreg =
SDIO->DCTRL;
463 SDIO->DCTRL = tmpreg;
520 return SDIO->FIFOCNT;
619 *(
__IO uint32_t *)
CMD_NIEN_BB = (uint32_t)((~((uint32_t)NewState)) & ((uint32_t)0x1));
673 if ((
SDIO->STA & SDIO_FLAG) != (uint32_t)
RESET)
709 SDIO->ICR = SDIO_FLAG;
749 if ((
SDIO->STA & SDIO_IT) != (uint32_t)
RESET)
#define IS_SDIO_TRANSFER_MODE(MODE)
uint32_t SDIO_TransferMode
#define IS_SDIO_CLEAR_FLAG(FLAG)
#define IS_SDIO_GET_IT(IT)
#define IS_SDIO_CLOCK_EDGE(EDGE)
void SDIO_SendCEATACmd(FunctionalState NewState)
Sends CE-ATA command (CMD61).
ITStatus SDIO_GetITStatus(uint32_t SDIO_IT)
Checks whether the specified SDIO interrupt has occurred or not.
void SDIO_ClearFlag(uint32_t SDIO_FLAG)
Clears the SDIO's pending flags.
void SDIO_SendSDIOSuspendCmd(FunctionalState NewState)
Enables or disables the SD I/O Mode suspend command sending.
void SDIO_CmdStructInit(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct)
Fills each SDIO_CmdInitStruct member with its default value.
uint32_t SDIO_DataBlockSize
uint32_t SDIO_ClockPowerSave
#define SDIO_DPSM_Disable
#define IS_SDIO_DATA_LENGTH(LENGTH)
#define IS_SDIO_RESP(RESP)
void SDIO_SetSDIOOperation(FunctionalState NewState)
Enables or disables the SD I/O Mode Operation.
void assert_param(int val)
void SDIO_DataConfig(SDIO_DataInitTypeDef *SDIO_DataInitStruct)
Initializes the SDIO data path according to the specified parameters in the SDIO_DataInitStruct.
#define IS_SDIO_HARDWARE_FLOW_CONTROL(CONTROL)
#define SDIO_DataBlockSize_1b
void SDIO_DMACmd(FunctionalState NewState)
Enables or disables the SDIO DMA request.
FlagStatus SDIO_GetFlagStatus(uint32_t SDIO_FLAG)
Checks whether the specified SDIO flag is set or not.
#define IS_SDIO_READWAIT_MODE(MODE)
#define SDIO_TransferDir_ToCard
#define IS_FUNCTIONAL_STATE(STATE)
void SDIO_DataStructInit(SDIO_DataInitTypeDef *SDIO_DataInitStruct)
Fills each SDIO_DataInitStruct member with its default value.
#define IS_SDIO_TRANSFER_DIR(DIR)
#define IS_SDIO_CLEAR_IT(IT)
void SDIO_ClearITPendingBit(uint32_t SDIO_IT)
Clears the SDIO's interrupt pending bits.
uint32_t SDIO_DataTimeOut
void SDIO_DeInit(void)
Deinitializes the SDIO peripheral registers to their default reset values.
uint32_t SDIO_GetPowerState(void)
Gets the power status of the controller.
void SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode)
Sets one of the two options of inserting read wait interval.
#define IS_SDIO_CMD_INDEX(INDEX)
void SDIO_StopSDIOReadWait(FunctionalState NewState)
Stops the SD I/O Read Wait operation.
#define IS_SDIO_CPSM(CPSM)
#define IS_SDIO_BLOCK_SIZE(SIZE)
#define IS_SDIO_CLOCK_POWER_SAVE(SAVE)
void SDIO_StructInit(SDIO_InitTypeDef *SDIO_InitStruct)
Fills each SDIO_InitStruct member with its default value.
#define SDIO_ClockEdge_Rising
void SDIO_SetPowerState(uint32_t SDIO_PowerState)
Sets the power status of the controller.
#define IS_SDIO_FLAG(FLAG)
#define IS_SDIO_BUS_WIDE(WIDE)
#define SDIO_ClockPowerSave_Disable
This file contains all the functions prototypes for the RCC firmware library.
void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct)
Initializes the SDIO Command according to the specified parameters in the SDIO_CmdInitStruct and send...
uint32_t SDIO_ClockBypass
void SDIO_ITConfig(uint32_t SDIO_IT, FunctionalState NewState)
Enables or disables the SDIO interrupts.
uint32_t SDIO_GetResponse(uint32_t SDIO_RESP)
Returns response received from the card for the last command.
uint32_t SDIO_GetFIFOCount(void)
Returns the number of words left to be written to or read from FIFO.
#define IS_SDIO_POWER_STATE(STATE)
void SDIO_CEATAITCmd(FunctionalState NewState)
Enables or disables the CE-ATA interrupt.
void SDIO_CommandCompletionCmd(FunctionalState NewState)
Enables or disables the command completion signal.
#define SDIO_CPSM_Disable
uint32_t SDIO_HardwareFlowControl
#define CMD_ENCMDCOMPL_BB
uint8_t SDIO_GetCommandResponse(void)
Returns command index of last command for which response received.
This file contains all the functions prototypes for the SDIO firmware library.
#define SDIO_ClockBypass_Disable
#define IS_SDIO_RESPONSE(RESPONSE)
uint32_t SDIO_TransferDir
#define SDIO_TransferMode_Block
#define IS_SDIO_CLOCK_BYPASS(BYPASS)
void SDIO_ClockCmd(FunctionalState NewState)
Enables or disables the SDIO Clock.
void SDIO_Init(SDIO_InitTypeDef *SDIO_InitStruct)
Initializes the SDIO peripheral according to the specified parameters in the SDIO_InitStruct.
uint32_t SDIO_GetDataCounter(void)
Returns number of remaining data bytes to be transferred.
#define IS_SDIO_DPSM(DPSM)
#define SDIO_HardwareFlowControl_Disable
void SDIO_WriteData(uint32_t Data)
Write one data word to Tx FIFO.
#define IS_SDIO_WAIT(WAIT)
void SDIO_StartSDIOReadWait(FunctionalState NewState)
Starts the SD I/O Read Wait operation.
uint32_t SDIO_ReadData(void)
Read one data word from Rx FIFO.
#define CMD_SDIOSUSPEND_BB